Home  >  Article  >  Backend Development  >  How to simulate QQ login with PHP, simulate login with php_PHP tutorial

How to simulate QQ login with PHP, simulate login with php_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:45:441006browse

How to simulate QQ login with PHP, simulate login with php

The example in this article describes the method of simulating QQ login with PHP. Share it with everyone for your reference. The specific implementation method is as follows:

The principle is to use curl to simulate sending post login, and the cookie is saved locally

This theoretically supports permanent QQ single listing

<&#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;>

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1039194.htmlTechArticleHow to simulate QQ login with PHP, php simulated login This article describes the method of simulating QQ login with PHP. Share it with everyone for your reference. The specific implementation method is as follows: The principle is to use curl to simulate sending...
Statement:
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