therealwesfoster Posted December 10, 2007 Share Posted December 10, 2007 Why isn't this working? <?php $page = file_get_contents("http://google.com/"); echo $page; ?> I just get a blank page with nothing in the source... ??? Whats up with it? Quote Link to comment Share on other sites More sharing options...
kratsg Posted December 10, 2007 Share Posted December 10, 2007 <?php if($page = file_get_contents("http://google.com/")){ echo $page; } else { echo "Uh-Oh! We cannot read this page!"; } ?> Quote Link to comment Share on other sites More sharing options...
therealwesfoster Posted December 10, 2007 Author Share Posted December 10, 2007 returns Uh-Oh! We cannot read this page! I've done this before.. what gives? Quote Link to comment Share on other sites More sharing options...
trq Posted December 10, 2007 Share Posted December 10, 2007 Alot of hosts disable fopen_wrappers which are needed to open remote files. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 10, 2007 Share Posted December 10, 2007 If you check your web server log for errors or turn on full php error reporting, you will probably find out why it is failing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.