bir dosyanın içinde url ler var ve bunları kendi hostumuza almak istiyoruz. bunun için aşağıdaki gibi bir kod yazdım sadece son satırdaki şeyi hosta indiriyor onun dışında hata veriyor.kodlardaki hata nerede acaba ?
<?php
$al = @fopen("txt.txt", "r");
while (!feof($al)) {
$link = fgets($al, 1024);
$kaynak = "http://$link"; // nerden alacak
$yeniisim=substr("$link", 14); // yeniisim
$open = fopen($yeniisim, 'w');
fwrite($open, file_get_contents($kaynak));
fclose($open);
}
?>txt.txt nin içeriği
www.xkare.org/deneme1.txt
www.xkare.org/deneme2.txt
www.xkare.org/deneme3.txt
www.xkare.org/deneme4.txt
hata mesajı
Alıntı
[09-Jan-2008 20:31:43] PHP Warning: file_get_contents(
http://www.xkare.org/deneme1.txt
) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/xkareor/public_html/oku/oku.php on line 11
[09-Jan-2008 20:31:43] PHP Warning: file_get_contents(
http://www.xkare.org/deneme2.txt
) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/xkareor/public_html/oku/oku.php on line 11
[09-Jan-2008 20:31:43] PHP Warning: file_get_contents(
http://www.xkare.org/deneme3.txt
) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/xkareor/public_html/oku/oku.php on line 11