signature.php 1.0 KB

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