chinchi86 Posted October 27, 2009 Share Posted October 27, 2009 Hello all, This is my code: $url = "userreview.php?reviewID=1"; $str = file_get_contents($url); echo $str; Simple, right? That's supposed to get the contents of userreview.php with reviewID as 1. But this doesn't work. Just typing userreview.php works, but the ?reviewID=1 does not work. How could I make it so that it works? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/179205-file_get_contents-not-working-for-some-reason/ Share on other sites More sharing options...
Bricktop Posted October 27, 2009 Share Posted October 27, 2009 Hi chinchi86, Try using the full URL in your $url variable, i.e.: $url = "http://www.yourdomain.com/userreview.php?reviewID=1"; Hope this helps. Quote Link to comment https://forums.phpfreaks.com/topic/179205-file_get_contents-not-working-for-some-reason/#findComment-945501 Share on other sites More sharing options...
PFMaBiSmAd Posted October 27, 2009 Share Posted October 27, 2009 http://www.phpfreaks.com/forums/index.php/topic,273977.msg1294735.html#msg1294735 Quote Link to comment https://forums.phpfreaks.com/topic/179205-file_get_contents-not-working-for-some-reason/#findComment-945512 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.