PHP怎么模拟登录移动游戏后台,一次只能给100分,不够再加

WBOY
Release: 2016-06-13 11:05:52
Original
1061 people have browsed it

PHP如何模拟登录移动游戏后台,急!一次只能给100分,不够再加!
PHP如何模拟登录移动游戏后台,后台地址:http://oss.cmgame.com/egbi/,最好能给出具体实现代码,谢谢!

这个页面需要输入账号密码后提交页面,使手机能获得验证码,手机验证码我可以通过程序读取,现在主要是想先通过模拟登录触发手机收到验证码。请问这一步需要怎么实现?
------解决方案--------------------
php curl
http://oss.cmgame.com/egbi/login.do
password intsig
userName synctest3
看了一下貌似不需要传什么额外的数据,跟一下cookie。
------解决方案--------------------
肯定是url的问题
你用抓包 跟踪一下 找出正确的 url
状态 200说明登录成功 肯定是登录成功 触发了某个url url不是那个 你找出正确的来
------解决方案--------------------
最好的方式是用curl模拟
但是模拟有时需要伪造cookie,有时候需要伪造SSH,视状况而定,這是我的curl方法


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,// 获取的信息以檔案流的形式返回,而不是直接输出。
CURLOPT_TIMEOUT => 30,

CURLOPT_SSL_VERIFYHOST => 1,// 从证书中检查SSL加密算法是否存在
CURLOPT_SSL_VERIFYPEER => 0,// 对认证证书来源的检查,0表示阻止对证书的合法性的检查

//偽造來路和IP
//CURLOPT_REFERER => 'http://www.yzswyl.cn/', //来路
//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, //端口
//CURLOPT_POST => 1, //发送一个常规的POST请求,类型为:application/x-www-form-urlencoded,就像表单提交的一样。
//CURLOPT_POSTFIELDS => $postfields,//要传送的所有数据,如果要传送一个檔案,[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);
}
Copy after login


捕捉了一下他的頭
ResponseHeaders
Date Thu, 13 Dec 2012 07:06:54 GMT
X-Powered-By Servlet/3.0
P3P CP=CAO PSA OUR
Content-Length 80
Server WebSphere Application Server/8.0
Content-Language en-US
Content-Type text/html;charset=utf-8
RequestHeaders
Content-Type application/x-www-form-urlencoded
X-Requested-With XMLHttpRequest
Accept application/json, text/javascript, */*

------解决方案--------------------
嘴巴說不清楚,只好录制动画了

Related labels:
source:php.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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!