在做微信支付,在获取用户的openid的时候,一直获取不到code各位大神帮看看

Ftm122710 2017-04-22 07:20:15
$appid="wx1279a423acc54c67";

$redirect_uri=urlencode("http://www.yihang88.cn/");

$url="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx1279a423acc54c67&redirect_uri=$redirect_uri&response_type=code&scope=snsapi_base&state=123#wechat_redirect";
//header("Location:$url");

$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_HEADER,0);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
curl_close($ch);
Log::write($result);

$code = $_GET['code'];
var_dump($code);exit;
...全文
64 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧