日期:2014-05-17 浏览次数:20687 次
<html>
<head>
<meta http-equiv="Content-Type" content="text/html"; charset="utf-8">
</head>
<body>
<form method="post" target='_blank' action="http://comment.ifeng.com/post.php" id="commentForm" name="commentForm">
<textarea onclick="changeBox();" class="" cols="50" rows="10" id="content" name="content">bbbbbbbbbbb</textarea>
<input type="hidden" value="11160676" name="docId">
<input type="hidden" value="吴卓羲女友张馨予家中大尺度内衣自拍照火辣曝光" name="docName">
<input type="hidden" value="http://yue.ifeng.com/y/detail_2011_12/07/11160676_0.shtml" name="docUrl">
<input type="hidden" value="21202" name="chId">
<input type="submit" style="margin-left:20px; display:inline" value="xxxxxxxxxxxx" >
</form>
</body>
</html>
header("content-type:text/html;charset:utf-8;");
/*
chId 21202
content mmmmmmmmm
docId 11160676
docName 吴卓羲女友张馨予家中大尺度内衣自拍照火辣曝光
docUrl http://yue.ifeng.com/y/detail_2011_12/07/11160676_0.shtml
*/
$url = "http://comment.ifeng.com/post.php";
//$url = "http://localhost/php/index.php";
$data = array(
'content'=>'xxxxxxxxxxoooooooooooo',
'docId'=>11160676,
'docName'=>'吴卓羲女友张馨予家中大尺度内衣自拍照火辣曝光',
'docUrl'=>'http://yue.ifeng.com/y/detail_2011_12/07/11160676_0.shtml',
'chId'=>21202
);
$ret = http_post($url,$data);
var_dump($ret);
function http_post($url, $data)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
$data = http_build_query($data);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_REFERER, "http://yue.ifeng.com/y/detail_2011_12/07/11160676_0.shtml");
$cookie = "userid=1323532473389_2814";
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
$rs = curl_exec($ch);
curl_close($ch);
return $rs;
}