PHP development about callback mode

php中世界最好的语言
Release: 2023-03-18 07:16:01
Original
1242 people have browsed it

We know that errors always occur when using callback mode to develop WeChat enterprise accounts, so this time we will bring you the solution to the error problem of callback mode in PHPPHP development, let’s take a look.

In fact, the WeChat development documentation is indeed very detailed, and using the official demo, you can use it directly as long as you make slight changes. But why does it always prompt an error?

Below I will first post the code for turning on the callback mode that I verified successfully

VerifyURL($sVerifyMsgSig, $sVerifyTimeStamp, $sVerifyNonce, $sVerifyEchoStr, $sEchoStr); if ($errCode == 0) { echo $sEchoStr; // // 验证URL成功,将sEchoStr返回 // HttpUtils.SetResponce($sEchoStr); } else { print("ERR: " . $errCode . "\n\n"); }
Copy after login

It can be seen that the above code is basically the same as the one given in the demo. The same code was also verified unsuccessfully one day ago. Research has found that the domain name used when verifying the URL must be a trusted domain name. ps: I am using Sina Cloud, but I did not perform real-name authentication, so there is a risk. After I authenticated my real-name, it was successfully opened.

Enlightenment: Official documents are never wrong. It is necessary to study official documents carefully. In the process of turning on the callback mode of the WeChat enterprise account, it is also very important that the domain name must be a trusted domain name.


# I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!

Related reading:

Examples to explain Ajax asynchronous request technology

What is the common syntax of AJAX

AJAX principles and CORS cross-domain methods

The above is the detailed content of PHP development about callback mode. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!