|
楼主 |
发表于 2014-3-22 11:19:00
|
显示全部楼层
<html>
<body>
<head>
<meta http-equiv="content-language" content="zh-cn"/>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<title>QQ空间留言</title>
</head>
<?php
$friend=$_POST["friend"];
$sid=$_POST["sid"];
$content=$_POST["content"];
$loop=$_POST["loop"];
function mypost($myurl)
{
$post_data = array();
//需要提交的post数据
$post_data['msg'] ="$content";
$post_data['B_UID']="$friend";
$post_data['ispostmsg'] = "1";
$post_data['submitbtn']="发表";
//目标地址
$url=$myurl;
foreach ($post_data as $k=>$v)
{
$o.= "$k=".urlencode($v)."&";
}
$post_data=substr($o,0,-1);
//开始通讯
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL,$url);
//为了支持cookie
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
//返回结果
$result = curl_exec($ch);
}
$i=0;
while($i<$loop)
{
mypost("http://blog60.z.qq.com/mmsgb/add_msg_action_switch.jsp?sid=$sid");
$i++;
} |
|