<?php
function get_random_proxy(){
srand ((double)microtime()*1000000);
$f_contents = file ("
http://www.myweb.com/proxys.txt");
$line = $f_contents[array_rand ($f_contents)];
return $line;
}
function get_curl_proxy($url){
$proxy_ip = get_random_proxy();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_PROXY, $proxy_ip);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_MAXREDIRS, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$u="
http://whatsmyip.org/";
echo get_curl_proxy($u);
?>
Bookmarks