手机
当前位置:查字典教程网 >编程开发 >php教程 >解析PHP跨站刷票的实现代码
解析PHP跨站刷票的实现代码
摘要:废话不多说,上代码复制代码代码如下:functioncurlrequest($url,$postfield,$referer='',$coo...

废话不多说,上代码

复制代码 代码如下:

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跨站刷票的实现代码】相关文章:

文件上传的实现

PHP4中实现动态代理

PHP的历史和优缺点

我的论坛源代码(一)

PHP中的traits实现代码复用使用实例

网站当前的在线人数

php使用cookie实现记住用户名和密码实现代码

PHP滚动日志的代码实现

PHPlet在Windows下的安装

支持中文的PHP按字符串长度分割成数组代码

精品推荐
分类导航