PHP simulates QQ login, php simulates Login
This article describes how to simulate QQ login in PHP. Share it with you for your reference. The specific implementation method is as follows:
The principle is to use curl to simulate post login, And the cookie is saved locally.
This theoretically supports permanent single-stick QQ
<? Php // http://blog.qita.in non-technical [S.T] $ qqno = 'your qq'; $ qqpw = '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' => $ qqpw, 'logintype' => '1', 'loginsubmit '=> 'login ',); $ curl = curl_init ('HTTP: // pt.3g.qq.com/handleLogin? Aid = nLoginHandle & sid = comment '); curl_setopt ($ curl, CURLOPT_HEADER, 0); curl_setopt ($ curl, expires, 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);?>
I hope this article will help you with php programming.