<?php// 本類由系統自動生成,僅供測試用途class IndexAction extends Action { public function index(){$timestamp=$_GET['timestamp'];$nonce=$_GET['nonce'];$token="weixin";$signature=$_GET['signature'];$array=array($timestamp,$nonce,$token);sort($array);//2.將排序后的三個參數拼接之后用sha1加密$temstr=implode('',$array);$temstr=sha1($temstr);//3.將加密后的字符串與signature進行對比,判斷該請求是否來自微信if($temstr==$signature){? echo $_GET['echostr'];? exit;}}?}?>
添加回答
舉報
0/150
提交
取消