Heim  >  Artikel  >  Backend-Entwicklung  >  PHP模拟QQ登录的方法,php模拟登录_PHP教程

PHP模拟QQ登录的方法,php模拟登录_PHP教程

WBOY
WBOYOriginal
2016-07-13 09:45:44981Durchsuche

PHP模拟QQ登录的方法,php模拟登录

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

原理是用curl模拟发送post登录,cookie保存本地

这样理论上可以支持永久单挂QQ

<&#63;php 
//http://blog.qita.in 非技术[S.T]
$qqno='你的QQ';
$qqpw='QQ密码';
$cookie = dirname(__FILE__).'/cookie.txt';
$post = array(
  'login_url' => 'http://pt.3g.qq.com/s&#63;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&#63;aid=nLoginHandle&sid=ATAll43N7ZULRQ5V8zdfojol');
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie); // &#63;Cookie
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
$result = curl_exec($curl);
curl_close($curl);
&#63;>

希望本文所述对大家的php程序设计有所帮助。

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1039194.htmlTechArticlePHP模拟QQ登录的方法,php模拟登录 本文实例讲述了PHP模拟QQ登录的方法。分享给大家供大家参考。具体实现方法如下: 原理是用curl模拟发送...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn