Home  >  Article  >  php教程  >  PHP模拟QQ登录的方法

PHP模拟QQ登录的方法

WBOY
WBOYOriginal
2016-06-06 19:49:57745browse

这篇文章主要介绍了PHP模拟QQ登录的方法,涉及php基于curl操作模拟QQ登录的实现技巧,具有一定参考

本文实例讲述了PHP模拟QQ登录的方法。分享给大家供大家参考。具体实现方法如下:

原理是用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程序设计有所帮助。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn