signature.php 861 B

1234567891011121314151617181920212223242526272829303132
  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. $xmldata=file_get_contents("php://input");
  12. Log::record("request ip:{$addr}",Log::DEBUG);
  13. Log::record("signature data : {$data}",Log::DEBUG);
  14. Log::record("HTTP_SIGN : {$sign}",Log::DEBUG);
  15. Log::record("XML_DATA : {$xmldata}",Log::DEBUG);
  16. echo ('SUCCESS');
  17. //var_dump($_POST);
  18. //echo("{$echostr}");
  19. //
  20. //$token = 'stanleykinghelloworld';
  21. //$tmpArr = [$token, $timestamp, $nonce];
  22. //sort($tmpArr, SORT_STRING);
  23. //$tmpStr = implode( $tmpArr );
  24. //$tmpStr = sha1( $tmpStr );
  25. //
  26. //if( $tmpStr == $signature ){
  27. // return true;
  28. //}else{
  29. // return false;
  30. //}