您好,欢迎访问一九零五行业门户网

PHP开发微信公众号,你的服务器没有正确响应Token验证,请阅读消息接口使用指南

在使用url和token启用微信公众平台开发模式消息接口的时候,显示]“ 你的服务器没有正确响应token验证,请阅读消息接口使用指南”,不知道是什么情况,我的token验证代码用的是开发文档里的示例代码,是在sae申请的服务器。代码如下(我看网上的解决方法,说写tracehttp()这个方法看log.html文件,但是我在服务器代码目录里边又没有找到log.html文件),求大神指导
valid ();
class wechat {
public function valid() {
$echostr = $_get [echostr];
if ($this->checksignature ()) {
echo $echostr;
exit ();
}
}
private function checksignature() {
$signature = $_get [signature];
$timestamp = $_get [timestamp];
$nonce = $_get [nonce];
$token = token;
$tmparr = array ($token, $timestamp, $nonce );
sort ( $tmparr, sort_string );
$tmpstr = implode ( $tmparr );
$tmpstr = sha1 ( $tmpstr );
if ($tmpstr == $signature) {
return true;
} else {
return false;
}
}
}
function tracehttp() {
logger(remote_addr: . $_server ['remote_addr'].
((strpos($_server ['remote_addr'],101.226))? from weixin: unknown ip));
logger(query_string:.$_server[query_string]);
}
function logger($content)
{
file_put_contents(\log.html,date('y-m-d h:i:s  ').$content.
,file_append);
}
?>
回复讨论(解决方案) 你访问的url是否报错?
都没错,我又在网上下载了一个代码包,但是和之前的一样。我重新上传了一遍,然后就可以访问了,不知道怎么回事。
其它类似信息

推荐信息