PHP simulates QQ login code

烟雨青岚
Release: 2023-04-08 22:30:02
forward
4879 people have browsed it

PHP simulates QQ login code

php simulates qq login code

This article describes how to simulate qq login in php. The principle is to use curl simulates sending a post to log in, and the cookie is saved locally. The code theory here can support permanent single-link QQ. Let us take a look below.

<?php
$qqno=&#39;你的QQ&#39;;
$qqpw=&#39;QQ密码&#39;;
$cookie = dirname(__FILE__).&#39;/cookie.txt&#39;;
$post = array(
    &#39;login_url&#39; => &#39;http://pt.3g.qq.com/s?sid=ATAll43N7ZULRQ5V8zdfojol&aid=nLogin&#39;,
    &#39;q_from&#39; => &#39;&#39;,
    &#39;loginTitle&#39; => &#39;login&#39;,
    &#39;bid&#39; => &#39;0&#39;,
    &#39;qq&#39; => $qqno,
    &#39;pwd&#39; => $qqpw,
    &#39;loginType&#39; => &#39;1&#39;,
    &#39;loginsubmit&#39; => &#39;login&#39;,
);
$curl = curl_init(&#39;http://pt.3g.qq.com/handleLogin?aid=nLoginHandle&sid=ATAll43N7ZULRQ5V8zdfojol&#39;);
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);
?>
Copy after login

Thank you everyone for reading, have you learned it?

This article is reproduced from: http://community.itbbs.cn/thread/21261/

Recommended tutorial: "php tutorial"

The above is the detailed content of PHP simulates QQ login code. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:itbbs.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template