This article mainly introduces the PHP simulated QQ login method, which involves the implementation skills of php simulated QQ login based on curl operations. for some reference, this article describes the PHP simulated QQ login method. 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.