微信公众号 认证TOKEN

时间:2021-06-05 17:35:32   收藏:0   阅读:0
<?php 
header("Content-type:text/html;charset=utf8");

date_default_timezone_set("RPC");
$signature = $_GET["signature"];    
  $timestamp = $_GET["timestamp"];    
 $nonce = $_GET["nonce"];     
 $echostr = $_GET["echostr"];
 
 $token = "dsadsad";
    $tmpArr = array($token, $timestamp, $nonce);    
       sort($tmpArr,SORT_STRING);    
         $tmpArr = implode( $tmpArr );    
         $tmpArr = sha1( $tmpArr );    
            
        if( $tmpArr == $signature ){    
       echo $echostr;
         }    

  在TP5框架中 把此文件放到public目录文件下 命名为renzheng.php 

     微信公众号 验证域名为https://www.xxx.com/renzheng.php

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!