-
微信簽名驗(yàn)證查看全部
-
xml格式根據(jù)微信公眾號(hào)的格式來給的,接受數(shù)據(jù)的信息從獲取參數(shù),$post查看全部
-
基于tp(thinkphp)框架查看全部
-
不錯(cuò)不錯(cuò)查看全部
-
curl查看全部
-
access_token查看全部
-
消息回復(fù)普通查看全部
-
事件推送查看全部
-
課程詳情查看全部
-
public function responemsg(){ //這個(gè)東西就可以把微信發(fā)來的消息給接收了,是一個(gè)XML $postArr = $GLOBALS['HTTP_RAW_POST_DATA']; file_put_contents('a.xml', $postArr); //接受了就開始處理了,這個(gè)函數(shù)把xml轉(zhuǎn)換為一個(gè)對(duì)象 $postObj = simplexml_load_string($postArr); //$postObj->ToUserName 公眾號(hào) // $postObj->FromUserName openid //$postObj->CreatTime 創(chuàng)建時(shí)間 // $postObj->MsgType 消息類型 //$postObj->Event if(strtolower($postObj->MsgType)=='event'){ if(strtolower($postObj->Event=='subscribe')){ $touser = $postObj->FromUserName; $fromuser= $postObj->ToUserName; $time = time(); $content= '歡迎關(guān)注'; $MsgType = 'text'; $temp = "<xml> <ToUserName><![CDATA[%s]]></ToUserName> <FromUserName><![CDATA[%s]]></FromUserName> <CreateTime>%s</CreateTime> <MsgType><![CDATA[%s]]></MsgType> <Content><![CDATA[%s]]></Content> </xml>"; $temp = trim($temp); $temp = sprintf($temp,$touser,$fromuser,$time,$MsgType,$content); echo $temp;查看全部
-
public function index(){ $nonce = $_GET['nonce']; $token = 'weixin'; $timestamp = $_GET['timestamp']; $echostr = $_GET['echostr']; $signature = $_GET['signature']; $array = array($nonce,$timestamp,$token); sort($array); $str = sha1(implode($array)); if($str == $signature && $echostr){ echo $echostr; exit; }else{ $this ->responemsg(); } }查看全部
-
獲取微信推送過來POST數(shù)據(jù)(XML格式) $GLOBALS("HTTP_RAW_POST_DATA");查看全部
-
很實(shí)用的教程。不知道未認(rèn)證的公眾號(hào)是否都可以用這些功能。查看全部
-
獲取微信ACCESS_TOKEN查看全部
-
123123查看全部
舉報(bào)
0/150
提交
取消