Code: Select all
$handle = curl_init();
curl_setopt ($handle, CURLOPT_HEADER, TRUE);
curl_setopt ($handle, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1");
curl_setopt ($handle, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt ($handle, CURLOPT_REFERER, "");
curl_setopt ($handle, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt ($handle, CURLOPT_MAXREDIRS, 5);
curl_setopt ($handle, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt ($handle, CURLOPT_FAILONERROR, TRUE);
curl_setopt ($handle, CURLOPT_COOKIESESSION, TRUE);
curl_setopt ($handle, CURLOPT_COOKIEFILE, "cookie.txt");
curl_setopt ($handle, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt ($handle, CURLOPT_HTTPPROXYTUNNEL, TRUE);
curl_setopt ($handle, CURLOPT_PROXY, "http://202.150.105.35:1080");
$url = "http://yahoo.com";
curl_setopt ($handle, CURLOPT_URL, $url);
$file_contents = curl_exec($handle); $ErrNo = curl_errno($handle);
if ($ErrNo != 0) echo "Error : $ErrNo : ".curl_error($handle);
echo $file_contents;
curl_close($handle);Any idea why ?
Thanks