问答详情
源自:-

token验证失败的问题

<?php
        //验证参数
        //1.将timestamp,nonce,token按字典顺序排序
        $timestamp=$_GET['timestamp'];
        $nonce=$_GET['nonce'];
        $token='weixin';
        $signature=$_GET['signature'];
        $array=array($timestamp,$nonce,$token);
        sort($array);
        //2.将三个排序后的参数拼接后用sha1加密
        $tmpstr=implode('',$array);//拼接 join
        $tmpstr=sha1($tmpstr);
        //3.将加密后的字符串与signature进行对比,判断该请求是否来自微信
        if($tmpstr==$signature){
            echo $_GET['echostr'];
            exit;
        }

这是我的代码。。我看了好多遍也没发现有问题哇。老师,我的是新浪云的二级域名能访问   http://hwwxhome.sinaapp.com/weixin.php


然后还有你回答别人的,说要先开启开发者模式,可是要填了之后才能启用。没配置过的启用不了

提问者:qq_尘封的记忆_2 2015-08-29 14:14

个回答

  • qq_尘封的记忆_2
    2015-08-29 14:20:07

    难道真的要在新浪云上实名认证么