本文整理汇总了PHP中wechatCallbackapiTest::response方法的典型用法代码示例。如果您正苦于以下问题:PHP wechatCallbackapiTest::response方法的具体用法?PHP wechatCallbackapiTest::response怎么用?PHP wechatCallbackapiTest::response使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wechatCallbackapiTest
的用法示例。
在下文中一共展示了wechatCallbackapiTest::response方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: response
<?php
require_once 'weixinlib/textmsg.php';
require_once 'weixinlib/secretmsg.php';
require_once 'weixinlib/clickmsg.php';
define('TOKEN', 'icoding520');
$wechatObj = new wechatCallbackapiTest();
$wechatObj->response();
class wechatCallbackapiTest
{
public function response()
{
$echoStr = $_GET['echostr'];
//valid signature , option
if ($this->checkSignature()) {
echo $echoStr;
$this->responseMsg();
exit;
}
}
public function responseMsg()
{
//get post data, May be due to the different environments
$postStr = $GLOBALS['HTTP_RAW_POST_DATA'];
//extract post data
if (!empty($postStr)) {
$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
$fromUsername = $postObj->FromUserName;
$toUsername = $postObj->ToUserName;
$getMsgType = $postObj->MsgType;
$PicUrl = '';
示例2: wechatCallbackapiTest
header('content-type:text/html;charset=utf-8');
ini_set("display_errors", "Off");
define("TOKEN", $_GET['token']);
date_default_timezone_set("PRC");
$wechatObj = new wechatCallbackapiTest();
$check_attached = $wechatObj->chaxun(0, $_GET['token'], 'get_member_detail');
$checked_info = mysql_fetch_array($check_attached);
if ($checked_info['attached'] == 0) {
$wechatObj->chaxun(0, TOKEN, 'updateattach');
}
if (isset($_GET['echostr'])) {
$wechatObj->valid();
}
define('uf', $_GET['token']);
define("serverip", $_SERVER['HTTP_HOST']);
$wechatObj->response(TOKEN);
class wechatCallbackapiTest
{
private $timestamp;
public $temp;
public $row = 0;
public $fromUsername;
public $toUsername;
public $firstView = true;
public $firstViewWord = true;
public $viewId;
public $viewing = 0;
public $piao = 0;
public $now;
public $MsgType;
public $T = 60;