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

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

關(guān)注微信公眾號(hào)沒有自動(dòng)回復(fù)?

關(guān)注微信公眾號(hào)沒有自動(dòng)回復(fù)?

PHP
有只小跳蛙 2019-03-09 04:55:25
<?php $nonce=$_GET['nonce']; $token='imooc'; $timestamp=$_GET['timestamp']; $echostr=$_GET['echostr']; $signature=$_GET['signature']; //形成數(shù)組,然后按字典序排序 $array=array(); $array=array($nonce,$timestamp,$token); sort($array); //拼接成字符串,sha1加密,然后與signature進(jìn)行檢驗(yàn) $str=sha1(implode($array)); if($str==$signature&&$echostr) { header('content-type:text'); //第一次接入微信API接口時(shí)候驗(yàn)證合法性 echo $echostr; exit; } else { responseMsg(); } function responseMsg() { //1.獲取到微信推送過來post數(shù)據(jù)(xml格式) $postArr=$GLOBALS['HTTP_RAW_POST_DATA']; //2.處理消息類型,并設(shè)置回復(fù)類型和內(nèi)容 $postObj=simplexml_load_string($postArr); //判斷該數(shù)據(jù)包是否是訂閱de事件推送 if(strtolower($postObj->MsgType)=='event') { //如果是關(guān)注 subscribe事件 if(strtolower($postObj->Event)=='subscribe') { $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; } } } 已經(jīng)是接入成功了 難道哪里有寫錯(cuò)了?為什么不會(huì)自動(dòng)回復(fù)?
查看完整描述

2 回答

?
猛跑小豬

TA貢獻(xiàn)1858條經(jīng)驗(yàn) 獲得超8個(gè)贊

感謝樓主和二樓,解決了我的問題!

查看完整回答
反對(duì) 回復(fù) 2019-03-18
  • 2 回答
  • 0 關(guān)注
  • 488 瀏覽

添加回答

舉報(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)