|
复制代码 代码如下:
function curlrequest($url, $postfield,$referer='',$cookie='') {
//http://www.jb51.NET
$ip= rand(100, 244).'.'.rand(100, 244).'.'.rand(100, 244).'.'.rand(100, 244);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfield);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-FORWARDED-FOR:'.$ip, 'CLIENT-IP:'.$ip)); //构造IP
curl_setopt($ch, CURLOPT_REFERER, $referer); //构造来路
$data = curl_exec($ch); //运行curl
curl_close($ch);
return $data;
}
$url='http://xxxxx/vote.php';
$ref='http://xxxxx/index.php';
$cookies='';//构造你的cookies
$postfield=array(
'information_id'=>201204211839164950
);
$postfield = http_build_query($postfield);
$result = curlrequest($url, $postfield,$ref,$cookies);
echo $result;
php技术:解析PHP跨站刷票的实现代码,转载需保留来源!
郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。