Brak opisu

callbackverify.php 984B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. include_once "WXBizMsgCrypt.php";
  3. // 假设企业号在公众平台上设置的参数如下
  4. $encodingAesKey = "jWmYm7qr5nMoAUwZRjGtBxmz3KA1tkAj3ykkR6q2B2C";
  5. $token = "QDG6eK";
  6. $receiveid = "wx5823bf96d3bd56c7";
  7. $wxcpt = new WXBizMsgCrypt($token, $encodingAesKey, $receiveid);
  8. // http://cq.xuduan.tech:62606/weworkapi_php/callback_json/callbackverify.php?msg_signature=5c45ff5e21c57e6ad56bac8758b79b1d9ac89fd3&timestamp=1409659589&nonce=263014780&echostr=P9nAzCzyDtyTWESHep1vC5X9xho%2FqYX3Zpb4yKa9SKld1DsH3Iyt3tP3zNdtp%2B4RPcs8TgAE7OaBO%2BFZXvnaqQ%3D%3D
  9. //
  10. // get the paramters
  11. $sVerifyMsgSig = $_GET['msg_signature'];
  12. $sVerifyTimeStamp = $_GET['timestamp'];
  13. $sVerifyNonce = $_GET['nonce'];
  14. $sVerifyEchoStr = $_GET['echostr'];
  15. $sEchoStr = "";
  16. // call verify function
  17. $errCode = $wxcpt->VerifyURL($sVerifyMsgSig, $sVerifyTimeStamp, $sVerifyNonce, $sVerifyEchoStr, $sEchoStr);
  18. if ($errCode == 0) {
  19. echo $sEchoStr . "\n";
  20. } else {
  21. print("ERR: " . $errCode . "\n\n");
  22. }
  23. ?>