PHP實現微信公眾平臺開發—基礎篇問題地址:http://www.xianlaiwan.cn/qadetail/216153 <?php
//1.將timestamp,nonce,toke按字典順序排序
$timestamp?=?$_GET['timestamp'];
$nonce?=?$_GET['nonce'];
$token?=?'zhangjun';
$signature?=?$_GET['signature'];
$array?=?array($timestamp,$nonce,$token);
//2.將排序后的三個參數拼接之后用sha1加密
$tmpstr?=?implode('',$array);
$tmpstr?=?sha1($tmpstr);
//3.將加密后的字符串與signature進行對比,判斷該請求是否來自微信
if($tmpstr?==?$signature){
????header('content-type:text');
????echo?$_GET['echostr'];
????exit;
}else{
????echo?123;
}輸出:123經過檢查發現$_GET不到值!??!
微信公眾平臺開發,$_GET不到值
qq_生活是一種態度_03951778
2017-05-10 10:50:32