0

Good day,

I have a script in PHP that gets contents from a URL. I used cURL for this. However, I wanted to get contents from proxy servers like http://www.canadaproxy.net/ and there seems to be no return values for the script.

Here are my PHP codes:

$url = "http://www.canadaproxy.net/browse.php?u=Oi8vd3d3Lmdvb2dsZS5jYS8%3D&b=5";
$timeout = 5;
$useragent = "Googlebot/2.1 (http://www.googlebot.com/bot.html)";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$raw = curl_exec($ch);
curl_close($ch);

var_dump($raw);

Any suggestion would be greatly appreciated.

Thanks!

1 Answer 1

1

URL should be: $url = "http://www.canadaproxy.net/includes/process.php?action=update";

Add

curl_setopt($ch,CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt"); curl_setopt($ch,CURLOPT_POST, true); curl_setopt($ch,CURLOPT_POSTFIELDS, "u=google.com"); 

and it will work

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.