废话不多说,上代码
function curlrequest($url, $postfield,$referer='',$co<strong style="color:transparent">本文来源gaodai#ma#com搞@@代~&码*网/</strong><strong>搞gaodaima代码</strong>okie='') { <BR> //http://www.gaodaima.com <BR> $ip= rand(100, 244).'.'.rand(100, 244).'.'.rand(100, 244).'.'.rand(100, 244); <BR> $ch = curl_init(); <BR> curl_setopt($ch, CURLOPT_URL, $url); <BR> curl_setopt($ch, CURLOPT_HEADER, 0); <BR> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); <BR> curl_setopt($ch, CURLOPT_POST, 1); <BR> curl_setopt($ch, CURLOPT_POSTFIELDS, $postfield); <BR> curl_setopt($ch, CURLOPT_COOKIE, $cookie); <BR> curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-FORWARDED-FOR:'.$ip, 'CLIENT-IP:'.$ip)); //构造IP <BR> curl_setopt($ch, CURLOPT_REFERER, $referer); //构造来路 <BR> $data = curl_exec($ch); //运行curl <BR> curl_close($ch); <BR> return $data; <BR> } <BR> $url='http://xxxxx/vote.php'; <BR> $ref='http://xxxxx/index.php'; <BR> $cookies='';//构造你的cookies <BR> $postfield=array( <BR> 'information_id'=>201204211839164950 <BR> ); <BR> $postfield = http_build_query($postfield); <BR> $result = curlrequest($url, $postfield,$ref,$cookies); <BR> echo $result; <BR>