Recently I opened a WeChat account to write something to my family and so on. Look, if you want to see it, this is it:
Then I unexpectedly saw the WeChat public account development on imooc. I’m exhausted from doing scientific research every day, so let’s do something that’s not so tiring.
WeChat public account development
1. Basics
1.1 Data interaction process
User "————" WeChat server "————" third-party server;
And, from left to right are requests, from right to left are responses;
1.2 API
--Configuration
Access API
Enter these two - therefore, prepare the server in advance. I use Tencent's. Anyway, they are all owned by the same company, so it is more convenient.
<span>$timestamp</span>=<span>$_GET</span>['timestamp'<span>]; </span><span>$nonce</span>=<span>$_GET</span>['nonce'<span>]; </span><span>$token</span>='weixin'<span>; </span><span>$signature</span>=<span>$_GET</span>['signature'<span>]; </span><span>$array</span>=<span>array</span>(<span>$timestamp</span>,<span>$nonce</span>,<span>$token</span><span>); </span><span>sort</span>(<span>$array</span><span>); </span><span>$tmpstr</span>=<span>implode</span>('',<span>$array</span><span>); </span><span>$tmpstr</span>=<span>sha1</span>(<span>$tmpstr</span><span>); </span><span>if</span> (<span>$tmpstr</span>==<span>$signature</span><span>){ </span><span>echo</span> <span>$_GET</span>['echostr'<span>]; </span><span>exit</span><span>; }</span>
The main thing is this piece of code, just put it in the URL you want to link to.
The specific reason is based on the regulations of Weixin. I don’t know much about it, so I have to check it out.
Develop something to play with tomorrow