Sunday, 18 August 2013

HTTP Curl Proxy [White-Screen]

HTTP Curl Proxy [White-Screen]

First of thank you for reading this. I have gone through majority of the
answers already posted here and I still can't figure why my cURL isn't
working with a proxy.
I have tried using several proxies and it all it ever does is give me a
white screen.
Here is the PHP Code:
function curl($url){ // Defining the basic cURL function
$proxy = '122.166.5.84:8080';
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT
6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko)
Chrome/18.0.1025.168 Safari/535.19');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
//curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxy_userpass);
$data = curl_exec($ch);
if($data === false || curl_error($ch)) {
return $data;
}else{
curl_close($ch);
return $data;
}
}
Anybody have any idea why it only shows a white screen?

No comments:

Post a Comment