MDanz Posted March 21, 2010 Share Posted March 21, 2010 i'm trying this below but it isn't working, the page is coming up blank. <?php $url = 'http://www.realgm.com'; function get_url_contents($url){ $crl = curl_init(); $timeout = 5; curl_setopt ($crl, CURLOPT_URL,$url); curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout); $ret = curl_exec($crl); curl_close($crl); return $ret; } ?> Quote Link to comment Share on other sites More sharing options...
devofash Posted March 21, 2010 Share Posted March 21, 2010 Have you got curl enabled? If yes, I cant see you calling the function in the your script. Are you calling it? Quote Link to comment Share on other sites More sharing options...
MDanz Posted March 21, 2010 Author Share Posted March 21, 2010 i got it from here http://www.howtogeek.com/howto/programming/php-get-the-contents-of-a-web-page-rss-feed-or-xml-file-into-a-string-variable/ how do i call a function? i'm still a newbie when it comes to coding. Quote Link to comment Share on other sites More sharing options...
devofash Posted March 21, 2010 Share Posted March 21, 2010 put the below line outside the function. echo get_url_contents($url); 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.