PHP How to simulate login mobile game backstage, nasty! Only 100 points at a time, not enough to add!
PHP How to simulate login mobile game backstage, backstage address: http://oss.cmgame.com/egbi/, the best can give specific implementation code, thank you!
This page needs to enter the account password to submit the page, so that the phone can obtain a verification code, mobile phone Verification code I can read through the program, and now mainly want to first through the simulation login trigger phone to receive the verification code. How does this step need to be implemented?
------Solution--------------------
PHP Curl
Http://oss.cmgame.com/egbi/login.do
Passwordintsig
UserNamesynctest3
Look at the seemingly no need to send any additional data, follow the cookie.
------Solution--------------------
It's definitely a URL problem.
You use the grab bag to track it. Find the correct URL
Status 200 Description Login Success must be successful login triggered a URL URL not the one you found right.
------Solution--------------------
The best way is to simulate with curl
But simulations sometimes require the forgery of a cookie, and sometimes the need to forge ssh, depending on the situation, this is my Curl method
Public Function __construct ($u) {
IF ($u = = ") {Return ';}
$this->url=& $u;
$r = Parse_url ($this->url);
$Cai = Curl_init ();
$Opt = Array (
Curlopt_url = $this->url,
Curlopt_referer = $r [' scheme ']. ':/ /'. $r [' Host '],
Curlopt_failonerror = 1,
Curlopt_followlocation = 1,
Curlopt_returntransfer = 1,//The information obtained is returned in the form of a file stream, rather than as a direct output.
Curlopt_timeout = 30,
Curlopt_ssl_verifyhost = 1,//Check the existence of SSL encryption algorithm from certificate
Curlopt_ssl_verifypeer = 0,//Inspection of the source of the certificate, 0 means that the verification of the legality of the certificate is blocked
Hypocrites Building Road and IP
Curlopt_referer = ' http://www.yzswyl.cn/',//antecedents
Curlopt_httpheader = = Array (' x-forwarded-for:8.8.8.8 ', ' client-ip:8.8.8.8 '),
Curlopt_header = 1,
Curlopt_proxy = ' 222.73.173.50:8080 ',
curlopt_proxyuserpwd = ' Username:password ',
Curlopt_port = 80,//Port
Curlopt_post = 1,//sends a regular POST request with the type: application/x-www-form-urlencoded, just like the form submitted.
Curlopt_postfields = $postfields,//All data to be transmitted, if a file is to be transmitted, [email protected] (' g=yes&username=see7di& Password=www.7di.net999&id=&code= ')
Curlopt_cookie = Getcook ($url),
Curlopt_useragent = ' mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) gecko/20100101 firefox/9.0.1 ',
Curlopt_cookiejar = Dirname (__file__). $cookie _jar,
Curlopt_cookiefile = Dirname (__file__). $cookie _jar,
);
Curl_setopt_array ($Cai, $Opt);
$this->html = curl_exec ($Cai);
IF (! $this->html) {
$this->html= '
Error number: '. Curl_errno ($Cai). '
Error: '. Curl_error ($Cai);
Curl_close ($Cai);
Return $this->html;
}
Curl_close ($Cai);
}
Caught him in the head.
Responseheaders
Datethu, Dec 07:06:54 GMT
x-powered-byservlet/3.0
P3pcp=cao PSA Our
Content-length80
Serverwebsphere Application server/8.0
Content-languageen-us
Content-typetext/html;charset=utf-8
Requestheaders
content-typeapplication/x-www-form-urlencoded
X-requested-withxmlhttprequest
Acceptapplication/json, Text/javascript, */*
------Solution--------------------
The mouth was not clear, so I had to record the animation.