<?php /** * * WeChat Interface for WeChat Subscribers Lite * * * */ global $token; define('IS_DEBUG', false); $wechatObj = new wechatCallbackapi($token); $valid = $wechatObj->valid(); if ($valid) { $wechatObj->responseMsg(get_data()); } else { header('Location: ' . home_url()); } exit; class wechatCallbackapi { private $token; private $data; public function __construct($_token, $_data = null) { $this->token = $_token; if ($_data != null) { $this->load($_data); } } public function load($_data)
<?php define('IN_ECS', true); error_reporting(0); require dirname(__FILE__) . '/../includes/init.php'; require 'callback.php'; $wechatObj = new wechatCallbackapi(); $wechatObj->valid($db); $base_url = 'http://' . $_SERVER['SERVER_NAME'] . '/'; $db->prefix = $ecs->prefix; $wechatObj->responseMsg($db, $user, $base_url);
<?php /* * *微信插件token处理 * */ global $token; $wechatObj = new wechatCallbackapi($token, get_data()); $valid = $wechatObj->valid(); if ($valid) { $wechatObj->saveMsgHistory(); $wechatObj->responseMsg(); } else { header('Location: ' . home_url()); } exit; class wechatCallbackapi { private $token; public function __construct($_token, $_data = null) { $this->token = $_token; if ($_data != null) { $this->data = $_data; } } //debug专用函数 public function setField($data) { $messageRow = array("content" => $data);