以下是微信开发者接口激活
define("TOKEN", "weixin");//token值不变,weixin可自定义
$wechatObj = new wechatCallbackapiTest();
if (!isset($_GET['echostr'])) {
$wechatObj->responseMsg();
}else{
$wechatObj->valid();
}
class wechatCallbackapiTest
{
//验证签名
public function valid()
{
$echoStr = $_GET["echostr"];
$signature = $_GET["signature"];
$timestamp = $_GET["timestamp"];
$nonce = $_GET["nonce"];
$token = TOKEN;
$tmpArr = array($token, $timestamp, $nonce);
sort($tmpArr);
$tmpStr = implode($tmpArr);
$tmpStr = sha1($tmpStr);
if($tmpStr == $signature){
echo $echoStr;
exit;
}
}
}
?>
推荐文章
2021-01-20 18:23:14
2021-01-22 17:24:38
2021-01-25 17:06:11
2021-01-28 17:37:27
2021-02-01 17:32:55
2021-02-03 17:41:37
2021-02-05 17:23:07
2021-02-08 16:59:58
稳定
产品可用性高于99.9%贴心
全国7*24小时客服热线专业
产品经理在线技术支持快速
快速上线运营快承诺
我们选择声誉坚持
10年专注高端品质开发