Hi Guys!
I'm trying to connect to a proxy server using PHP CURL method. The proxy IP is a hidemyass.com. I get a blank page when I try using the following script, am I doing something wrong?
PHP Code:$url = "http://www.mydomain.com";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_COOKIE, $cookies);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "field1=value1&field2=value2");
curl_setopt($ch, CURLOPT_REFERER, 'http://www.google.com');
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt($ch, CURLOPT_PROXY, "109.73.65.130");
curl_setopt($ch, CURLOPT_HTTPHEADER,
array(
"Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3",
"Accept-Language: en-US,en;q=0.8",
"Cache-Control: max-age=0",
"Connection: keep-alive",
"Content-Type: application/x-www-form-urlencoded",
"User-Agent:".$_SERVER['HTTP_USER_AGENT'],
"Cookie: ".implode(" ",$new_cookies)));
$response = curl_exec($ch);
print_r($response); exit;



Reply With Quote

Bookmarks