谁会用php模拟登陆微信公众平台?测试成功的奖励一百分
1个回答
2014-06-12
展开全部
<?php
$cookie_jar = tempnam('./temp','cookie');
$post['username'] = '你的账号';
$post['此哗pwd'] = md5('你的密码');
$post['p'] = 'json';
$post['cktime']='祥扒信31536000';
$post['hideid']='0';
$post['lgt']='0';
$post['step']='2';
$link = "http://mp.weixin.qq.com/cgi-bin/login?lang=zh_CN";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch,CURLOPT_REFERER,"https://mp.weixin.qq.com/cgi-bin/login?lang=zh_CN");
//curl_setopt($ch,CURLOPT_REFERER,"http://bbs.php100.com/login.php");
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/谨轮5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_jar);
$output = curl_exec($ch);
curl_close($ch);
echo strip_tags($output);
?>
$cookie_jar = tempnam('./temp','cookie');
$post['username'] = '你的账号';
$post['此哗pwd'] = md5('你的密码');
$post['p'] = 'json';
$post['cktime']='祥扒信31536000';
$post['hideid']='0';
$post['lgt']='0';
$post['step']='2';
$link = "http://mp.weixin.qq.com/cgi-bin/login?lang=zh_CN";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch,CURLOPT_REFERER,"https://mp.weixin.qq.com/cgi-bin/login?lang=zh_CN");
//curl_setopt($ch,CURLOPT_REFERER,"http://bbs.php100.com/login.php");
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/谨轮5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_jar);
$output = curl_exec($ch);
curl_close($ch);
echo strip_tags($output);
?>
追问
给我返回的这个:{"base_resp":{"ret":0,"err_msg":"ok"},"redirect_url":"\/cgi-bin\/home?t=home\/index&lang=zh_CN&token=1563478266"}
什么意思?后面的地址是什么意思
追答
成功了呀。。。。。这不就是你要的登录成功后返回的json报文么
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询