第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

微信關(guān)于接收事件推送不顯示問題

微信關(guān)于接收事件推送不顯示問題

PHP
homedevise 2016-10-02 12:35:04
<?php class?IndexAction?extends?Action?{ public?function?_construct(){ } ????public?function?index(){ ???? $nonce=$_GET['nonce']; ???? $token='zhongmei'; ???? $timestamp=$_GET['timestamp']; $signature=$_GET['signature']; ???? $echostr=$_GET['echostr']; ???? $array=array(); ???? $array=array($nonce,$timestamp,$token); ???? sort($array); ???? $str=sha1(implode($array)); ???? if($str==$signature?&&?$echostr){ ???? echo?$echostr; ???? exit; ???? }else?{ ???? $this->reponseMsg(); ???? } ????} public?function?reponseMsg(){ ?????//1.獲取到微信推送過來post數(shù)據(jù)(xml格式) ?????$postArr?=?$GLOBALS('HTTP_RAW_POST_DATA'); ?????//2.處理消息類型,并設(shè)置回復(fù)類型和內(nèi)容 ?????$postObj?=?simplexml_load_string($postArr);//轉(zhuǎn)化成對(duì)象 ?????//$postObj->ToUserName=''; ?????//$postObj->FromUserName=''; ?????//$postObj->CreateTime?=''; ?????//$postObj->MsgType=''; ?????//$postObj->Event=''; ?????//判斷該數(shù)據(jù)包是否是訂閱的時(shí)間推送 ?????if(?strtolower(?$postObj->MsgType)?==?'event'){ ?????????//如果是關(guān)注subscribe事件 ?????????if(?strtolower($postObj->Event?==?'subscribe')?){ ?????????????//回復(fù)用戶消息 ????????? $toUser????=?$postObj->FromUserName; ????????? $fromUser??=?$postObj->toUserName; ????????? $time??????=?time(); ????????? $msgType???=?'text'; ????????? $content???=?'歡迎關(guān)注我們的微信公眾賬號(hào)'; ????????? $template??=?"<xml> ??????????????????????????<ToUserName><![CDATA[%s]]></ToUserName> ??????????????????????????<FromUserName><![CDATA[%s]]></FromUserName> ??????????????????????????<CreateTime>%s</CreateTime> ??????????????????????????<MsgType><![CDATA[%s]]></MsgType> ??????????????????????????<Content><![CDATA[%s]]></Content> ??????????????????????????</xml>"; ????????????$info??????=?sprintf($template,?$toUser,?$fromUser,?$time,?$msgType,?$content); ????????????echo?$info; ?????????} ?????} ?????if(?strtolower(?$postObj->MsgType)?==?'text'){ ?????????if(?strtolower($postObj->Content?==?'zhongmei')?){ ????????? $template??=?"<xml> ??????????????????????????<ToUserName><![CDATA[%s]]></ToUserName> ??????????????????????????<FromUserName><![CDATA[%s]]></FromUserName> ??????????????????????????<CreateTime>%s</CreateTime> ??????????????????????????<MsgType><![CDATA[%s]]></MsgType> ??????????????????????????<Content><![CDATA[%s]]></Content> ??????????????????????????</xml>"; ????????????$fromUser=$postObj->ToUserName; ????????????$toUser=$postObj->FromUserName; ????????????$time=time(); ????????????$content='zhongmei?is?good'; ????????????$msgType='text'; ????????????echo?sprintf($template,$toUser,$fromUser,$time,$msgType,$content); ?????????} ?????} ????} }首先微信中服務(wù)器配置已經(jīng)更改為自己的了,token也改了。但在啟用服務(wù)器配置并訂閱后什么推送消息都沒有,輸入zhongmei后也沒有返回值,只返回該公眾號(hào)暫時(shí)無法提供服務(wù),請(qǐng)稍后再試。請(qǐng)幫忙看看哪里出問題了,謝謝!
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 2580 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)