search

Home  >  Q&A  >  body text

WeChat official account interface configuration information failed

QQ截图20190215085511.png


##<?php

define('TOKEN','peter');

$signature =$_GET['signature']; //Encrypted signature

$timestamp=$_GET['timestamp'];//Timestamp

$nonce=$_GET['nonce'] ;//Random number

$echostr=$_GET['echostr'];//Random string

//Sort the array

$arr=[$timestamp ,$nonce,TOKEN];

sort($arr,SORT_STRING);

$str=sha1(implode($arr));

//This request is From WeChat

if($signature==$str){

echo $echostr;

}

?>


yangyangyangyang2188 days ago1340

reply all(2)I'll reply

  • 明日边缘

    明日边缘2019-03-01 16:10:53

    Not all the code is written

    reply
    0
  • Cancelreply