signature.php 744 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. //Log::record("This is signatrue file.");
  3. //
  4. //$signature = $_GET["signature"];
  5. //$timestamp = $_GET["timestamp"];
  6. //$nonce = $_GET["nonce"];
  7. //$echostr = $_GET["echostr"];
  8. $data = json_encode($_POST);
  9. $sign = $_SERVER['HTTP_SIGN'];
  10. $addr = $_SERVER['REMOTE_ADDR'];
  11. Log::record("request ip:{$addr}",Log::DEBUG);
  12. Log::record("signature data : {$data}",Log::DEBUG);
  13. Log::record("HTTP_SIGN : {$sign}",Log::DEBUG);
  14. echo ('success');
  15. //echo("{$echostr}");
  16. //
  17. //$token = 'stanleykinghelloworld';
  18. //$tmpArr = [$token, $timestamp, $nonce];
  19. //sort($tmpArr, SORT_STRING);
  20. //$tmpStr = implode( $tmpArr );
  21. //$tmpStr = sha1( $tmpStr );
  22. //
  23. //if( $tmpStr == $signature ){
  24. // return true;
  25. //}else{
  26. // return false;
  27. //}