- //Welcome to back.zhizhi123.com
- //Reference blog post http://back.zhizhi123.com/?p=126
- set_time_limit(0);//Prevent timeout
-
- function toupiao($i)
-
- {
-
- $proxy = array('182.48.116.51:8080','110.177.63.191:9999','221.10.40.238:80','221.10.40.236:83','221.10. 40.237:80','221.10.102.199:82','42.121.0.247:9999','42.121.28.111:3128','117.135.194.139:80','119.147.91.21:80','58.247.1 09.243: 80','118.233.36.246:8585');
-
- $url = "http://www.example.com/tea/love.php";
-
- $ch = curl_init();
-
- $data = array (
- 'id' => '13'
- );
-
- //Set the source address. If not set, the forum server may be verified and not allowed to reply
-
- curl_setopt($ch,CURLOPT_REFERER,"http://www .example.com/tea/index.php?m=content&c=index&a=lists&catid=10");
-
- //Can save cookies
-
- curl_setopt($ch,CURLOPT_COOKIESESSION,true);
-
- curl_setopt($ch,CURLOPT_USERAGENT,"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)");
-
- curl_setopt($ch, CURLOPT_PROXY, $ proxy[$i]);
-
- curl_setopt($ch, CURLOPT_POST, 1);
-
- curl_setopt($ch, CURLOPT_HEADER, 0);
-
- curl_setopt($ch, CURLOPT_URL,$url);
-
- //For support cookie
-
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
-
- $result = curl_exec($ch);
-
- if(curl_errno($ch))
-
- {
-
- echo 'Curl error: ' . curl_error($ ch);
-
- }
-
- }
-
- for($i=0;$i<=11;$i++)
-
- {
-
- echo "begin the ".$i."th vote";
-
- toupiao( $i);
-
- echo 'end';
-
- echo "";
-
- }
Copy code
|