• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wechatCallbackapiTest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wechatCallbackapiTest的典型用法代码示例。如果您正苦于以下问题:PHP wechatCallbackapiTest类的具体用法?PHP wechatCallbackapiTest怎么用?PHP wechatCallbackapiTest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了wechatCallbackapiTest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _yanzhengAct

 /**
  * 合法性验证
  * 文档地址:http://mp.weixin.qq.com/wiki/index.php?title=%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97
  */
 function _yanzhengAct()
 {
     define("TOKEN", "cailai123");
     $wechatObj = new wechatCallbackapiTest();
     $wechatObj->valid();
     exit;
 }
开发者ID:GStepOne,项目名称:CI,代码行数:11,代码来源:class.act.wx.php


示例2: wechatCallbackapiTest

<?php

//功能是提供大转盘的兑换,目前是加积分2,且只有一个奖项
$wechatObj = new wechatCallbackapiTest();
$wechatObj->responseMsg();
class wechatCallbackapiTest
{
    public function responseMsg()
    {
        $keyword = trim($_GET['quan']);
        $fromUsername = $_GET['name'];
        require_once 'conn.php';
        preg_match_all("/[A-Za-z0-9]/", $keyword, $match01);
        $select = $match01[0];
        foreach ($select as $val) {
            $abc .= $val;
        }
        $item = substr($abc, 4, 2);
        //创建时间记录
        $t = time();
        $datestamp = date("Y-m-d H:i:s", $t);
        //更新历史列表
        $checklist = mysql_fetch_array(mysql_query("select * from shop_history where secret = '{$abc}'"));
        if (!empty($checklist) && $checklist['used'] == "NO") {
            mysql_query("UPDATE shop_history SET used = 'YES', usedtime='{$datestamp}' WHERE secret = '{$abc}'");
            //获取积分
            $result_jifen = mysql_fetch_array(mysql_query("select * from jifen where user like '%{$fromUsername}%'"));
            if ($item == "04") {
                $score_changed = $result_jifen['score'] + 4;
                //增加积分量
            } elseif ($item == "01") {
开发者ID:sueflybaby,项目名称:learngit,代码行数:31,代码来源:roll_makeitused_v5kf.php


示例3: define

<?php

/**
 * wechat php test
 */
//define your token
define("TOKEN", "baigungun");
$wechatObj = new wechatCallbackapiTest();
$wechatObj->valid();
class wechatCallbackapiTest
{
    public function valid()
    {
        $echoStr = $_GET["echostr"];
        //valid signature , option
        if ($this->checkSignature()) {
            echo $echoStr;
            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)) {
            /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,
               the best way is to check the validity of xml by yourself */
            libxml_disable_entity_loader(true);
            $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
            $fromUsername = $postObj->FromUserName;
开发者ID:sirxun,项目名称:uploadImag,代码行数:31,代码来源:wx_sample.php


示例4: define

<?php

/**
 * wechat php test
 */
//define your token
define("TOKEN", "weixin");
$wechatObj = new wechatCallbackapiTest();
$wechatObj->valid();
$wechatObj->responseMsg();
class wechatCallbackapiTest
{
    public function valid()
    {
        $echoStr = $_GET["echostr"];
        //valid signature , option
        if ($this->checkSignature()) {
            echo $echoStr;
            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;
            $keyword = trim($postObj->Content);
开发者ID:will0306,项目名称:bianli100,代码行数:31,代码来源:wx_sample.php


示例5: define

<?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 = '';
开发者ID:roryliu,项目名称:icoding,代码行数:31,代码来源:icoding.php


示例6: define

<?php

require_once "config.php";
/**
 * wechat php test
 */
//define your token
define("TOKEN", "woijodsj23232jdofijweo323ioj");
$wechatObj = new wechatCallbackapiTest();
//$wechatObj->valid();
$wechatObj->setAppid($appid, $secret);
$wechatObj->responseMsg();
class wechatCallbackapiTest
{
    private $appid;
    private $secret;
    public function setAppid($appid, $secret)
    {
        $this->appid = $appid;
        $this->secret = $secret;
    }
    public function valid()
    {
        $echoStr = $_GET["echostr"];
        //valid signature , option
        if ($this->checkSignature()) {
            echo $echoStr;
            exit;
        }
    }
    public function responseMsg()
开发者ID:AnderLX,项目名称:wechat,代码行数:31,代码来源:index.php


示例7: header

<?php

header("content-type:text/html;charset=utf-8");
// echo "klkdlkl";die;
require_once '../common/php/dbaccess.php';
require_once '../common/php/configSelf.php';
require_once 'sdk_sunpeijun.php';
require_once '../common/php/config.php';
traceHttp();
define("TOKEN", "weixin");
//微信端验证token
define('IP', "www.chinwhiz.cn");
$db = new DB();
$wechatObj = new wechatCallbackapiTest();
$access_token = $wechatObj->getAccessToken($appIdSelf, $appSecretSelf);
$wx = new wechat($appIdSelf, $appSecretSelf, $access_token);
if (isset($_GET['echostr'])) {
    $wechatObj->valid();
} else {
    //$wx->sendMsgToAll();
    $wechatObj->responseMsg();
    //  	$wechatObj->createMenu();
}
class wechatCallbackapiTest
{
    public function valid()
    {
        $echoStr = $_GET["echostr"];
        if ($this->checkSignature()) {
            ob_clean();
            echo $echoStr;
开发者ID:sunpeijun,项目名称:wechat_subscribe,代码行数:31,代码来源:index_sunpeijun2.php


示例8: wechatCallbackapiTest

<?php 
/**
 * wechat php test
 */
include 'weixinlib/textmsg.php';
include 'weixinlib/secretmsg.php';
$wechatObj = new wechatCallbackapiTest();
$wechatObj->responseMsg('<xml><ToUserName><![CDATA[gh_3b9f2b7cbeb1]]></ToUserName>
<FromUserName><![CDATA[onJi-jkBg94_yLkoQLmlVFDTPqfk]]></FromUserName>
<CreateTime>1364050029</CreateTime>
<MsgType><![CDATA[text]]></MsgType>
<Content><![CDATA[kk]]></Content>
<MsgId>5858550264762860409</MsgId>
</xml>');
class wechatCallbackapiTest
{
    public function valid()
    {
        $echoStr = $_GET['echostr'];
        //valid signature , option
        if ($this->checkSignature()) {
            echo $echoStr;
            $this->responseMsg();
            exit;
        }
    }
    public function responseMsg($postStr)
    {
        //get post data, May be due to the different environments
        //	$postStr = $GLOBALS['HTTP_RAW_POST_DATA'];
        //extract post data
开发者ID:roryliu,项目名称:icoding,代码行数:31,代码来源:testii.php


示例9: header

<?php

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;
开发者ID:snamper,项目名称:CI_xiaoshuhaochi,代码行数:31,代码来源:weixin_api.php


示例10: error_reporting

<?php

/**
 * wechat php test
 */
require_once "src/JPush/JPush.php";
use sinacloud\sae\Storage;
error_reporting(E_ALL ^ E_NOTICE);
define("TOKEN", "weixin");
$wechatObj = new wechatCallbackapiTest();
if (isset($_GET['echostr'])) {
    $wechatObj->valid();
} else {
    $postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
    if (!empty($postStr)) {
        libxml_disable_entity_loader(true);
        $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
        $fromUsername = $postObj->FromUserName;
        $toUsername = $postObj->ToUserName;
        $type = $postObj->MsgType;
        $customevent = $postObj->Event;
        $latitude = $postObj->Location_X;
        //获取纬度
        $longitude = $postObj->Location_Y;
        //获取经度
        $label = $postObj->Label;
        //获取地理信息
        $voice = $postObj->Recognition;
        //为语音识别结果
        $keyword = trim($postObj->Content);
        $time = time();
开发者ID:zekaigit,项目名称:yijianchelian,代码行数:31,代码来源:weixin.php


示例11: wechatCallbackapiTest

<?php

require 'config.php';
$wechatObj = new wechatCallbackapiTest();
$wechatObj->valid();
require 'ImagePoster.php';
$wechatObj->forwardToWeibo();
class wechatCallbackapiTest
{
    var $poster;
    public function valid()
    {
        $echoStr = $_GET["echostr"];
        //valid signature , option
        if ($this->checkSignature()) {
            echo $echoStr;
        }
    }
    public function forwardToWeibo()
    {
        $this->poster = new ImagePoster();
        //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);
            $msgType = $postObj->MsgType;
            $fromUsername = $postObj->FromUserName;
            $key = $fromUsername . 'key';
            $toUsername = $postObj->ToUserName;
            if ($msgType == 'image') {
开发者ID:XinRan5312,项目名称:webot,代码行数:31,代码来源:weixin.php


示例12: index

 public function index()
 {
     /*{{{*/
     $wechatObj = new wechatCallbackapiTest();
     if (isset($_GET['echostr'])) {
         $wechatObj->valid();
     } else {
         $wechatObj->responseMsg();
     }
 }
开发者ID:codekissyoung,项目名称:kanjiebao,代码行数:10,代码来源:Jizipu.php


示例13: define

<?php

define('TOKEN', 'weixin');
define('APP_ID', 'wx2bac5dc50633192c');
define('APP_SECRET', '8a7b3729c3187dd130a1e77c515e5025');
$wechatObj = new wechatCallbackapiTest();
if (isset($_GET['echostr'])) {
    $wechatObj->valid();
} else {
    //$wechatObj->responseMsg();
    $wechatObj->Run();
}
//$wechatObj->Run();
class wechatCallbackapiTest
{
    private $fromUsername;
    private $toUsername;
    private $time;
    private $keyword;
    private $app_id;
    private $app_secret;
    private $data;
    private $token;
    public function __construct()
    {
        $this->app_id = APP_ID;
        $this->app_secret = APP_SECRET;
        $this->token = TOKEN;
        $this->data = '{' . '"button":[' . '{"name":"马上报修","type":"view","url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx2bac5dc50633192c&redirect_uri=http%3a%2f%2frepairtest.sinaapp.com%2fTiketRaise.php&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"},' . '{"name":"工单查询","type":"view","url":"http://repairtest.sinaapp.com/ServiceDesk.php"}' . ']}';
    }
    /**
开发者ID:0ostreamo0,项目名称:CallRepair,代码行数:31,代码来源:setup.php


示例14: define

<?php

/**
 * wechat php test
 */
//define your token
define("TOKEN", "weather");
$wechatObj = new wechatCallbackapiTest();
//$wechatObj->valid();
//$wechatObj->responseMsg();
$wechatObj->responseImgMsg();
class wechatCallbackapiTest
{
    public function valid()
    {
        $echoStr = $_GET["echostr"];
        //valid signature , option
        if ($this->checkSignature()) {
            echo $echoStr;
            exit;
        }
    }
    public function responseImgMsg()
    {
        //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;
开发者ID:dlpc,项目名称:Weather-weixin,代码行数:31,代码来源:index.php


示例15: wechatCallbackapiTest

<?php

/**
 * wechat php test
 */
//define your token
//define("TOKEN", "hillock");
require_once 'config.php';
$wechatObj = new wechatCallbackapiTest();
$wechatObj->index();
//include 'SimpleImage.php';
class wechatCallbackapiTest
{
    public function index()
    {
        if ($_SERVER['REQUEST_METHOD'] == "POST") {
            $this->responseMsg();
        } else {
            if ($_SERVER['REQUEST_METHOD'] == "GET") {
                $this->valid();
            } else {
                // OTHER
            }
        }
    }
    public function valid()
    {
        $echoStr = $_GET["echostr"];
        //valid signature , option
        if ($this->checkSignature()) {
            echo $echoStr;
开发者ID:shonve,项目名称:i-Pper,代码行数:31,代码来源:weixin.php



注:本文中的wechatCallbackapiTest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wfConfig类代码示例发布时间:2022-05-23
下一篇:
PHP webservice类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap