file get contents
4
●969
- 20-05-2007, 10:06:47Fonksiyona izin veriyordur. Örneğin;bowfinger adlı üyeden alıntı: mesajı görüntüle
<?php echo file_get_contents('index.php'); ?>yi çalıştırın çalışacaktır. http://www.site.com şeklinde uzak bağlantılara izin vermiyordur.
Eğer file_get_contents fonksiyonu desteklenmiyorsa sayfanın üstüne şunu ekleyip deneyin
if (!function_exists('file_get_contents')) { function file_get_contents($file) { $handler = fopen($file,'r'); if ($handler) { $contents = fread($handler, filesize($file)); fclose($handler); return $contents; } else { return false; } } } - 20-05-2007, 11:00:58
<? function site_kaynak($url) { if (function_exists('curl_init')) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); return curl_exec($ch); } else { return file_get_contents($url); } } ?>bu kodu ekle sayfana sonrasında file_get_contents yazdığın yere site_kaynak yaz
ör:
file_get_contents('http://www.youtube.com'); yerine
site_kaynak('http://www.youtube.com'); yaz