chriswadams
Joined: Tue Dec 01, 2009 12:54 am Posts: 26
|
Posted: Thu Aug 12, 2010 1:47 am Post subject: Practical PHP Programming -- Can't open remote file |
|
|
Hey everyone --
I'm working through the "Practical PHP Programming" book on TuxRadar, and found this snippet of code (at http://www.tuxradar.com/practicalphp/8/14/0):
| Code: |
<?php
$slash = fopen("http://www.slashdot.org", "r");
$site = fread($slash, 200000);
fclose($slash);
print $site;
?>
|
The book says:
| Quote: |
"Try saving the above code into a file, "openremote.php", and loading it into your web browser - you should see Slashdot displayed",
|
but when I did that, I got nothing but a blank screen. I changed "www.slashdot.org" to a local file, and that worked fine, but no non-local files will display (except for one site, http://www.townhall.com/columnists, which only displayed the blue background of the title bar).
Does anyone have any suggestions as to why this code isn't working? Any input would be appreciated.
chriswadams. |
|