手机
当前位置:查字典教程网 >编程开发 >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跨站刷票的实现代码】相关文章:

用PHP实现文件上传

网站当前的在线人数

PHP嵌套输出缓冲代码实例

PHP滚动日志的代码实现

PHP的类 功能齐全的发送邮件类

PHP SPL标准库中的常用函数介绍

PHP实现远程下载文件到本地

PHP_Flame(Version:Progress)的原代码

留言板翻页的实现详解

用PHP实现XML备份Mysql数据库

精品推荐
分类导航