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? Link to comment https://forums.phpfreaks.com/topic/80951-file_get_contents-not-working/ 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!"; } ?> Link to comment https://forums.phpfreaks.com/topic/80951-file_get_contents-not-working/#findComment-410658 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? Link to comment https://forums.phpfreaks.com/topic/80951-file_get_contents-not-working/#findComment-410669 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. Link to comment https://forums.phpfreaks.com/topic/80951-file_get_contents-not-working/#findComment-410676 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. Link to comment https://forums.phpfreaks.com/topic/80951-file_get_contents-not-working/#findComment-410688 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.