国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

? ?? ??? ?? ?? WeChat ????? ??? ?? ??? ??

WeChat ????? ??? ?? ??? ??

Mar 24, 2017 pm 02:12 PM

?? ???? ?? ??? ????, ?? ?? ??? ??? ????.

?? ??? ???? ??? ??? ? GET ??? ?? ??? Url? ?????. , ??? 4?? ????? ?????:

* ?? — WeChat ???? ??

* ????? — ?????

* nonce — ??? ??

* echostr — ??? ???

???? ??? ???? URL ???? ???? ?????. ? GET ??? echostr ???? ??? ??? ???? ???? ????, ??? ??? ???? ?????. ?? ??? ???? ??? ?? ????, ????? ???? ? ?? ????? ?????. ??? ????? ??? ????.

* ??, ?????, ??? ? ?? ????? ????? ?????.

* ? ?? ????? ?????. ???? ???? SHA1 ???? ?? ??? ???? ?????.

* ???? ?? ???? ???? ??? ???? ??? WeChat?? ?????? ??? ? ????.

??:

<?  
        $signature = $_GET[&#39;signature&#39;];  
        $timestamp = $_GET[&#39;timestamp&#39;];  
        $nonce = $_GET[&#39;nonce&#39;];      
                  
        $token = TOKEN;  
        $tmpArr = array($token, $timestamp, $nonce);  
        sort($tmpArr);  
        $tmpStr = implode( $tmpArr );  
        $tmpStr = sha1( $tmpStr );  
          
        if( $tmpStr == $signature ){  
            return $_GET[&#39;echostr&#39;];  
        }else{  
            return false;  
        }  
?>

??? WeChat? ??? ??? json? ???? ????.

??? XML ???? ??? ?? ????? simplexml_load_string? ???? ???. POST ???? urlencode? ???? HTTP_RAW_POST_DATA? ???? ???? ?? ? ????.

ToUserName ??? ???? WeChat ID, ????? ?? ??? ?? WeChat ID

FromUserName ??? ?? ??? WeChat ID

CreateTime ??? ?? ??

MsgType ?? ???? ???

??? ??? ??

<?php  
$postStr = $GLOBALS["HTTP_RAW_POST_DATA"]; //符合微信的POST規(guī)范  
if (!emptyempty($postStr))  
{  
 
    $postObj = simplexml_load_string($postStr, &#39;SimpleXMLElement&#39;, LIBXML_NOCDATA); //XML轉(zhuǎn)對(duì)象函數(shù),可能最近這一兩年入行的不太清楚XML函數(shù)  
      
    //數(shù)據(jù)從對(duì)象取出  
    $fromUsername = $postObj->FromUserName;   
    $toUsername = $postObj->ToUserName;  
    $CreateTime = $postObj->CreateTime;  
    $MsgType = $postObj->MsgType;  
    $Content = $postObj->Content;  
 
    $keyword = trim($postObj->Content); //安全Trim  
    $time = time();  
    //XML數(shù)據(jù)體  
    $textTpl = "<xml>   
               <ToUserName><![CDATA[%s]]></ToUserName>  
               <FromUserName><![CDATA[%s]]></FromUserName>  
               <CreateTime>%s</CreateTime>  
               <MsgType><![CDATA[%s]]></MsgType>  
               <Content><![CDATA[%s]]></Content>  
               <FuncFlag>0</FuncFlag>  
               </xml>";  
    if(!emptyempty( $keyword )) //如果發(fā)信息來(lái)了,不是空白POST,微信規(guī)定立即回復(fù),不用推送.  
    {  
        $msgType = "text"; //定義類型  
        $contentStr = "Hello World,I am Tater!"; //回復(fù)  
        $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr); //記住,Tpl是要載入的  
        echo $resultStr; //輸出,以便微信抓!  
    }  
    else 
    {  
        echo "What are you say!"; //輸入信息有問(wèn)題,提示輸入!  
    }  
 
}  
else 
{  
    echo "";  
    exit;  
}  
 
 
?>

? ??? WeChat ????? ??? ?? ??? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1601
29
PHP ????
1502
276
???