早睡早起,方能养生
Sleep early rise early, way to keep healthy

php微信开发,获取微信公众号登录code 测试代码

super
2024-04-09 16:24
views 235

<?php

$appId="appid";
$redirectUrl=urlencode('https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
if($_GET['code']){
    echo $_GET['code'];
    echo "<a href='?code='>重新获取</a>";
    exit;
}
Header('Location: https://open.weixin.qq.com/connect/oauth2/authorize?appid='.$appId.'&redirect_uri='.$redirectUrl.'&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect');


分享
0 条讨论
top