webdesign
Regular Member
- May 9, 2009
- 430
- 121
I've been doing a lot of research, but can't seem to get it to work..
The best & most recent thing I have read has been this..
From this DP thread. I'm not 100% sure if it works or not, as I only have proxy's with passwords to test.
I've seen loads of code examples for this with passwords in my searching, but I can't seem to get any of them to work.
Anyone able to help? I'm using this to make it easier to manage my proxys - on my server instead of having to manually change proxy's every-time I want to update a profile in my browser.
The best & most recent thing I have read has been this..
Code:
<?php
$proxy = ""; // must be like proxyip[IMG]http://s.dpstatic.com/smilies/tongue.png[/IMG]ort (00.00.00.00:8080)
function curl_get_contents(){
global $proxy;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7");
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$res = curl_exec($ch);
return $res;
curl_close($ch);
}
echo curl_get_contents('http://www.example.com/'); // replace file_get_contents with curl_get_contents
?>
I've seen loads of code examples for this with passwords in my searching, but I can't seem to get any of them to work.
Code:
http://enam.wordpress.com/2006/11/21/how-to-use-socks-proxy/
http://www.higherpass.com/php/Tutorials/Using-Curl-To-Query-Remote-Servers/3/
http://jdev.blogsome.com/2007/01/15/php-proxy-authentication/
http://www.developer.com/java/other/article.php/1551421/Questions-on-HttpURLConnection-and-Proxies.htm
http://www.sitepoint.com/forums/showthread.php?t=644769
http://gaps33.wordpress.com/2009/11/10/fb-freeeezzzeer-versi-php/
Last edited: