token驗(yàn)證失敗
<?php? ? ? ?//微信驗(yàn)證代碼
? ? ? ? ? ?//echo 'hello weixin imooc';
? ?//將timestamp,nonce,token按字典序排序
? ?$timestamp =$_GET['timestamp'];
? ?$nonce? ? ?=$_GET['nonce'];
? ?$token ='123456';
? ?$singnature=$_GET['singnature'];
? ?$array? ? ?=array($timestamp,$nonce,$token);
? ?sort($array);
? ?//將排序后的三個參數(shù)拼接后用sha1加密
? ?$tmpstr=implode('',$array);//join
? ?$tmpstr=sha1($tmpstr);
? ?//將加密后的字符串與signature進(jìn)行對比,判斷該請求是否來自微信
? ?if($tmpstr== $signature){
? ?echo $_GET['echostr'];
? ?exit;
? ?}
2019-06-17
?$singnature=$_GET['signature'];
2019-06-17
第6行sign