php投票小程序
程序员文章站
2022-03-21 13:26:00
...
'13' ); //设置来源地址,如果不设置,论坛服务器有可能有验证不允许回复 curl_setopt($ch,CURLOPT_REFERER,"http://www.example.com/tea/index.php?m=content&c=index&a=lists&catid=10"); //能保存cookie 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); //为了支持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 第".$i."次投票"; toupiao($i); echo 'end'; echo ""; }