本文整理匯總了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;