PHP implementation of QQ Login instance code, PHPQQ login instance
Share a piece of code that uses PHP to implement QQ login, the principle is to use Curl analog send post login, cookies saved locally, to achieve a real 3GQQ landing. Here code theory can support permanent single hanging qq-really do free hang qq OH.
<?phpfunction Qqlogin () {$qqno = ' here to fill in the QQ account number '; $QQPW = ' Here to fill in the QQ password '; $cookie = DirName (__file__). ' /cookie.txt '; $post = Array (' login_url ' = ' http://pt.3g.qq.com/s?sid=ATAll43N7ZULRQ5V8zdfojol&aid=nLogin ', ' Q_from ' + ', ' logintitle ' = ' login ', ' bid ' = ' 0 ', ' qq ' = $qqno, ' pwd ' and '-$QQPW, ' Logintype ' and ' 1 ', ' Loginsubmit ' = ' login ',); $url = ' http://pt.3g.qq.com/handleLogin?aid=nLoginHandle&sid= Atall43n7zulrq5v8zdfojol ';//Request Url$curl = Curl_init (); curl_setopt ($curl, Curlopt_header, 0); curl_setopt ($curl, Curlopt_url, $url); curl_setopt ($curl, Curlopt_returntransfer, 1); curl_setopt ($curl, Curlopt_ Cookiejar, $cookie);//? Cookiecurl_setopt ($curl, Curlopt_post, 1); curl_setopt ($curl, Curlopt_postfields, Http_build_query ($post)); $result = Curl_exec ($curl); Curl_close ($curl);}? >qqlogin ();
How to check if the login is successful:
After running this code, your QQ will be squeezed out, pop up the following tips, this time you can log in to your other QQ number to see your test number of the landing status.
Articles you may be interested in:
- QQ Login PHP OAuth Sample code
- PHP Simulation method of QQ Login
http://www.bkjia.com/PHPjc/1091852.html www.bkjia.com true http://www.bkjia.com/PHPjc/1091852.html techarticle PHP Implementation of the QQ login instance code, PHPQQ login instance to share a section of the use of PHP to realize the QQ landing code, the principle is to send a post login with curl, cookies saved locally, to achieve the real 3GQQ landing ...