PHP: how to simulate logon to the mobile game background! You can only give 100 points at a time, not enough! PHP simulates how to log on to the background of a mobile game. The backend address is http://oss.cmgame.com/egbi/. it is best to give it a practical and modern code. thank you! On this page, you need to enter your account and password and submit the page so that your mobile phone can obtain the verification code. you can use PHP to simulate logon to the mobile game background! You can only give 100 points at a time, not enough!
PHP simulates how to log on to the background of a mobile game. The backend address is http://oss.cmgame.com/egbi/. it is best to give it a practical and modern code. thank you!
On this page, you need to enter the account and password and submit the page so that the mobile phone can obtain the verification code. I can read the verification code through the program. now I want to trigger the mobile phone to receive the verification code through simulated logon. How does one implement this step?
------ Solution --------------------
Php curl
Http://oss.cmgame.com/egbi/login.do
Passwordintsig
UserNamesynctest3
It seems that no additional data needs to be transmitted. let's talk about the cookie.
------ Solution --------------------
It must be a url issue.
You can use the packet capture method to trace the correct url.
Status 200 indicates that the login is successful. the login is successful, and a url is triggered.
------ Solution --------------------
The best way is to use curl to simulate
However, the simulation sometimes requires cookie forgery, and sometimes requires SSH forgery, 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 obtained information is returned in the form of a response stream, rather than directly output.
CURLOPT_TIMEOUT => 30,
CURLOPT_SSL_VERIFYHOST => 1, // check whether the SSL encryption algorithm exists from the certificate
CURLOPT_SSL_VERIFYPEER => 0, // checks the certificate Source. 0 indicates that the certificate validity is blocked.
// Create a path and an IP address
// CURLOPT_REFERER => 'http: // www.yzswyl.cn/', // lailu
// CURLOPT_HTTPHEADER => Array ('x-FORWARDED-FOR: 8.8.8.8 ', 'client-IP: 8.8.8.8.8 '),
// CURLOPT_HEADER => 1,
// CURLOPT_PROXY => '192. 73.173.50: 661 ',
// CURLOPT_PROXYUSERPWD => 'username: password ',
// CURLOPT_PORT => 80, // port
// CURLOPT_POST => 1, // send a regular POST request in the type of application/x-www-form-urlencoded, just like submitting a form.
// CURLOPT_POSTFIELDS => $ postfields, // all data to be transmitted. if you want to transmit a transfer case, you need a file name ('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 );
}
Captured his head
ResponseHeaders
DateThu, 13 Dec 2012 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 --------------------
I couldn't speak clearly, so I had to record the animation.