首页 热点专区 义务教育 高等教育 出国留学 考研考公

PHP微信测试号验证服务器的时候接口配置提示配置成功但是没有得到url参数

发布网友

我来回答

1个回答

热心网友

建议你按照我的配置,再测试一下:
public function index(){
//获得参数 signature nonce token timestamp echostr
$nonce = $_GET['nonce'];
$token = 'weixin';
$timestamp = $_GET['timestamp'];
$echostr = $_GET['echostr'];
$signature = $_GET['signature'];
//形成数组,然后按字典序排序
$array = array();
$array = array($nonce, $timestamp, $token);
sort($array);
//拼接成字符串,sha1加密 ,然后与signature进行校验
$str = sha1( implode( $array ) );
if( $str == $signature && $echostr ){
//第一次接入weixin api接口的时候
//(第一次,有四个参数,signature、nonce、timestamp、echostr,第二次就没有echostr参数)
echo $echostr;
exit;
}else{
$this->reponseMsg();//接收事件推送并回复
}
}追问谢谢

热心网友

建议你按照我的配置,再测试一下:
public function index(){
//获得参数 signature nonce token timestamp echostr
$nonce = $_GET['nonce'];
$token = 'weixin';
$timestamp = $_GET['timestamp'];
$echostr = $_GET['echostr'];
$signature = $_GET['signature'];
//形成数组,然后按字典序排序
$array = array();
$array = array($nonce, $timestamp, $token);
sort($array);
//拼接成字符串,sha1加密 ,然后与signature进行校验
$str = sha1( implode( $array ) );
if( $str == $signature && $echostr ){
//第一次接入weixin api接口的时候
//(第一次,有四个参数,signature、nonce、timestamp、echostr,第二次就没有echostr参数)
echo $echostr;
exit;
}else{
$this->reponseMsg();//接收事件推送并回复
}
}追问谢谢

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com