In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains the "php how to solve the problem of automatically sending a message to Subscription account after token verification, but there is no message return". The content in the article is simple and clear, and it is easy to learn and understand. Now please follow the editor's train of thought to slowly deepen, together to study and learn "how to solve the problem of automatically sending a message to Subscription account after token verification in php, but there is no message return" bar.
I believe that many people will be like me, after token verification, send a message to Subscription account, no message returned.
Here, let's talk about the solutions I've worked hard to debug:
First, token verification:
The token I wrote failed all the time. I searched for it for a long time, but I didn't find bug. There was nothing I could do about it, so I used the official sample code. And through the sample code debugging, I found a bug (not counting bug) that made me spit blood:
Token verification seems to require character encoding format!
Official sample code, upload directly to the server, token directly through!
Change the official sample code to UTF-8 format, and then upload overwrite, token failed! Failure! Failure!
Later, to modify their own writing to ANSI format or token failed! Drunk! drunk! Then we have to use the official sample code. Here, to say that token is a handshake verification, once verified is not needed.
Now, to get to the point, it seems to be beside the point. Orz.
After token verification, directly use the official sample code, quickly test your own Subscription account, the result. The message sent out was like the water thrown out, and no ghost returned. Orz.
And all kinds of looking for bug, all kinds of group questions, all kinds of searches. After the efforts of the owner of this blog in 9981, we have finally found out where the problem lies:
1, the most easily ignored bug, the official sample code, did not call the written responseMsg () function at all!
2. Comment the previous token code, that is, $wechatObj- > valid (); this line of code. Because there will be an echo $echostr in the code verified by toke, the echo $resultStr; (line 56) xml in the responseMsg () function will be confused and cannot be recognized when returned to the Wechat server (it seems that only xml format can be recognized, as well as json format). (token verification is a handshake verification. After verifying the developer, you can stop using it and quickly make it disappear in our neat code orz....)
3, the most disgusting bug, or the character coding problem! Orz...xml requires UTF-8 encoding, so change the sample code back to UTF-8 coding! This bug found makes me break down!
The following is my modified code, can run normally, no bug, you can refer to what you need
Thank you for your reading, the above is the content of "how to solve the problem of automatically sending a message to Subscription account after token verification in php but there is no message return". After the study of this article, I believe you have a deeper understanding of how to solve the problem of automatically sending a message to Subscription account after token verification in php, but there is no message return. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.