dreamwest Posted July 9, 2009 Share Posted July 9, 2009 Im trying to learn curl, but the script endlessly loads set_time_limit(0); // create a new cURL resource $ch = curl_init(); // set default curl options curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt'); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11"); $g_url = http://site.com/page.html; echo "Fetching...<br>"; curl_setopt($ch, CURLOPT_URL, $g_url); echo "test<br>"; $html = curl_exec($ch); echo"test2"; if (strlen($html)>0) { echo "ok"; } This echos : Fetching... test Its sticking on this part for some reason: $html = curl_exec($ch); Quote Link to comment https://forums.phpfreaks.com/topic/165333-trying-to-learn-curl/ 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.