标签:
<?php
$data=array(‘name‘=>‘paul‘,‘mail‘=>‘paulversion@163.com‘)
$data=http_build_query($data);
$opts=array(
‘http‘=>array(
‘method‘=>‘Post‘,
‘header‘=>"Content-type:application/x-www-form-urlencode\r\n",
‘Content-Length‘:".strlen($data)."\r\n",
‘Cookie‘:‘‘,//现在浏览器中提交获取相应的Cookie User_Agent,Referer的值
‘User-Agent‘:‘‘,
‘Referer‘:‘‘,
‘content‘=>$data
)
)
$context=stream_context_create($opts);
$html=file_get_contents(url,false,$context)//url为灌水需要提交的地址
?>
标签:
原文地址:http://www.cnblogs.com/paulversion/p/5511170.html