作者:情歌怎厸唱狂想曲 | 来源:互联网 | 2018-03-23 16:58
原理是用curl模拟发送post登录,COOKIE保存本地
这里代码理论可以支持永久单挂QQ
'http://pt.3g.qq.com/s?sid=ATAll43N7ZULRQ5V8zdfojol&aid=nLogin',
'q_from' => '',
'loginTitle' => 'login',
'bid' => '0',
'qq' => $qqno,
'pwd' => $qqpw,
'loginType' => '1',
'loginsubmit' => 'login',
);
$curl = curl_init('http://pt.3g.qq.com/handleLogin?aid=nLoginHandle&sid=ATAll43N7ZULRQ5V8zdfojol');
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_COOKIEJAR, $COOKIE); // ?COOKIE
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
$result = curl_exec($curl);
curl_close($curl);
?>
以上就是PHP模拟QQ登录的内容,更多相关内容请关注PHP中文网(www.php1.cn)!