<?php// 本類由系統(tǒng)自動(dòng)生成,僅供測(cè)試用途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.將排序后的三個(gè)參數(shù)拼接之后用sha1加密$temstr=implode('',$array);$temstr=sha1($temstr);//3.將加密后的字符串與signature進(jìn)行對(duì)比,判斷該請(qǐng)求是否來自微信if($temstr==$signature){? echo $_GET['echostr'];? exit;}}?}?>
- 1 回答
- 1 關(guān)注
- 961 瀏覽
添加回答
舉報(bào)
0/150
提交
取消