signature.php 763 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. //var_dump($_POST);
  16. //echo("{$echostr}");
  17. //
  18. //$token = 'stanleykinghelloworld';
  19. //$tmpArr = [$token, $timestamp, $nonce];
  20. //sort($tmpArr, SORT_STRING);
  21. //$tmpStr = implode( $tmpArr );
  22. //$tmpStr = sha1( $tmpStr );
  23. //
  24. //if( $tmpStr == $signature ){
  25. // return true;
  26. //}else{
  27. // return false;
  28. //}