signature.php 953 B

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