Practical PHP Programming -- Can't open remote file

Code junkies hangout here

Moderators: ChriThor, LXF moderators

Practical PHP Programming -- Can't open remote file

Postby chriswadams » Thu Aug 12, 2010 12:47 am

Hey everyone --

I'm working through the "Practical PHP Programming" book on TuxRadar, and found this snippet of code (at

Code: Select all
    $slash = fopen("", "r");
    $site = fread($slash, 200000);
    print $site;

The book says:

"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 "" to a local file, and that worked fine, but no non-local files will display (except for one site,, 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.

Posts: 27
Joined: Tue Dec 01, 2009 12:54 am

Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest