943,189 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 1388
  • PHP RSS
Mar 21st, 2010
0

curl webpage into string variable help

Expand Post »
i'm trying this below but it isn't working, the page is coming up blank ..

PHP Syntax (Toggle Plain Text)
  1. <?php
  2. $url = 'http://www.realgm.com';
  3. function get_url_contents($url){
  4. $crl = curl_init();
  5. $timeout = 5;
  6. curl_setopt ($crl, CURLOPT_URL,$url);
  7. curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);
  8. curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);
  9. $ret = curl_exec($crl);
  10. curl_close($crl);
  11. return $ret;
  12. }
  13.  
  14. ?>
Last edited by MDanz; Mar 21st, 2010 at 2:15 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster
MDanz is offline Offline
146 posts
since Sep 2009
Mar 22nd, 2010
0
Re: curl webpage into string variable help
Click to Expand / Collapse  Quote originally posted by MDanz ...
i'm trying this below but it isn't working, the page is coming up blank ..

PHP Syntax (Toggle Plain Text)
  1. <?php
  2. $url = 'http://www.realgm.com';
  3. function get_url_contents($url){
  4. $crl = curl_init();
  5. $timeout = 5;
  6. curl_setopt ($crl, CURLOPT_URL,$url);
  7. curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);
  8. curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);
  9. $ret = curl_exec($crl);
  10. curl_close($crl);
  11. return $ret;
  12. }
  13.  
  14. ?>
That all you got or is there more?
Reputation Points: 10
Solved Threads: 13
Junior Poster
OS_dev is offline Offline
108 posts
since Feb 2010

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: ord() $textstring[$i] and without $i
Next Thread in PHP Forum Timeline: help with my code





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC