php扫码关注公众号回调,微信扫码关注公众号并登录PHP源码

class wechatCallbackapiTest {

public function valid() {

$echoStr = $_GET["echostr"];

if ($echoStr) {

if ($this->checkSignature()) {

file_put_contents('access_token.txt', "jj." . date("Y-m-d H:i:s"));

echo $echoStr;

} else {

file_put_contents('access_token.txt', "dd." . date("Y-m-d H:i:s"));

}

} else {

$this->responseMsg();

exit;

}

}

public function responseMsg() {

file_put_contents('userinfo.txt', date("Y-m-d H:i:s"));

$postStr = $GLOBALS["HTTP_RAW_POST_DATA"];

if (!empty($postStr)) {

include_once 'config.php';

$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);

你可能感兴趣的:(php扫码关注公众号回调)