Page 1 of 1

Problem with Fopen

Posted: Thu Oct 22, 2009 4:21 am
by sygnylmz
I'm trying to get the contents of an external file and display it on my page but the code doesn't seem to work. Do you have any idea what's the problem here? Thank you for your time.

Code: Select all

<?
 
$fd = fopen ("http://www.google.com", "r");
while (!feof ($fd)) {
$yaks= fgets($fd, 4096);
echo $yaks;
}
fclose ($fd);
 
?>
 

Re: Problem with Fopen

Posted: Thu Oct 22, 2009 7:44 am
by markusn00b
Do you receive any errors? What *does* happen? What *doesn't* happen?

My guess is that your PHP configuration has allow_url_fopen set to off.