微信轻接触,信轻接触
微信轻接触,信轻接触
微信越来越火了,但我一直对微信似乎没有什么感觉。我觉得有了QQ,基本上对腾讯的其它产品没有兴趣了。
不过,近期一个同学,打算建立一个微官网。知道我对网页技术这块有所了解,便希望让我制作一个。之后,我便下载了微信,注册了公众号......阅读一些开发者文档后,才发微信里面有很多我从前没有了解到的东西。
说了一堆,下面简单的说一下微官网制作过程吧:
1、进入微信公众平台:https://mp.weixin.qq.com/,注册一个公众号,注册过程简单,就不介绍了。
2、登录公众号后,打开公众号设置,填写一些设置信息,当然,最好把公众号的头像给上传一个,这样就有了自己公众号的形象了。
3、点击“开发者中心”,有一个“服务器配置”项,填写一个你自己的网站(用于做公众号平台的)地址,地址是一个与公众号做接口用的网址页面(一般是动态的文件地址,比如.php或.asp或.jsp等),我这里使用的开发语言是php,所以注册的地址是:http://www.xxxxxxxxxx.com/weixin/wx.php。
4、填写Token,这个就是一个密钥一样的东西,你随便拟一个字符串,相当于口令。我设置的是 wwwcom2015。
5、消息加密方式,填写明文即可,用于测试已够用了。
6、然后在你对应网站服务器的weixin/wx.php文件当中,写一个类文件,比如class wxcall{}。
7、在wxcall里面至少写以下这几个方法:
(1)验证消息真实性:
<span>private</span> <span>function</span><span> checkSignature() { </span><span>$signature</span> = <span>$_GET</span>["signature"<span>]; </span><span>$timestamp</span> = <span>$_GET</span>["timestamp"<span>]; </span><span>$nonce</span> = <span>$_GET</span>["nonce"<span>]; </span><span>$token</span> =<span> TOKEN; </span><span>$tmpArr</span> = <span>array</span>(<span>$token</span>, <span>$timestamp</span>, <span>$nonce</span><span>); </span><span>sort</span>(<span>$tmpArr</span>,<span> SORT_STRING); </span><span>$tmpStr</span> = <span>implode</span>( <span>$tmpArr</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>return</span> <span>true</span><span>; }</span><span>else</span><span>{ </span><span>return</span> <span>false</span><span>; } }</span>
(2)验证:
<span>function</span><span> valid(){ </span><span>if</span>(<span>$this</span>-><span>checkSignature()){ </span><span>echo</span> <span>$_GET</span>['echostr'<span>]; </span><span>exit</span><span>; } }</span>
(3)回复消息:
<span>function</span><span> responseMsg(){ </span><span>//</span><span>写你自己想要回复消息的一系列动作</span> <span> }</span>
8、通过上面几个方法,验证消息的真实性后(一般验证一次就可以管2个小时了),就可以回复消息了。
至少消息如何回复,回复的内容有什么技巧。下回再分说。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



DeepSeek: A powerful AI image generation tool! DeepSeek itself is not an image generation tool, but its powerful core technology provides underlying support for many AI painting tools. Want to know how to use DeepSeek to generate images indirectly? Please continue reading! Generate images with DeepSeek-based AI tools: The following steps will guide you to use these tools: Launch the AI Painting Tool: Search and open a DeepSeek-based AI Painting Tool (for example, search "Simple AI"). Select the drawing mode: select "AI Drawing" or similar function, and select the image type according to your needs, such as "Anime Avatar", "Landscape"

Gate.io, a leading cryptocurrency trading platform founded in 2013, provides Chinese users with a complete official Chinese website. The website provides a wide range of services, including spot trading, futures trading and lending, and provides special features such as Chinese interface, rich resources and community support.

Gateio Exchange app download channels for old versions, covering official, third-party application markets, forum communities and other channels. It also provides download precautions to help you easily obtain old versions and solve the problems of discomfort in using new versions or device compatibility.

Gate.io (Sesame Open Door) is the world's leading cryptocurrency trading platform. This article provides a complete tutorial on spot trading of Gate.io. The tutorial covers steps such as account registration and login, KYC certification, fiat currency and digital currency recharge, trading pair selection, limit/market transaction orders, and orders and transaction records viewing, helping you quickly get started on the Gate.io platform for cryptocurrency trading. Whether a beginner or a veteran, you can benefit from this tutorial and easily master the Gate.io trading skills.

This article provides a detailed guide to safe download of Ouyi OKX App in China. Due to restrictions on domestic app stores, users are advised to download the App through the official website of Ouyi OKX, or use the QR code provided by the official website to scan and download. During the download process, be sure to verify the official website address, check the application permissions, perform a security scan after installation, and enable two-factor verification. During use, please abide by local laws and regulations, use a safe network environment, protect account security, be vigilant against fraud, and invest rationally. This article is for reference only and does not constitute investment advice. Digital asset transactions are at your own risk.

The OKX trading platform offers a variety of rates, including transaction fees, withdrawal fees and financing fees. For spot transactions, transaction fees vary according to transaction volume and VIP level, and adopt the "market maker model", that is, the market charges a lower handling fee for each transaction. In addition, OKX also offers a variety of futures contracts, including currency standard contracts, USDT contracts and delivery contracts, and the fee structure of each contract is also different.

For investors new to the cryptocurrency world, it is crucial to understand how to buy virtual coins. This article is designed to provide a comprehensive guide to beginners covering detailed steps on how to choose the right exchange, register an account, deposit funds, and purchase Ethereum (ETH). By following this guide, beginners can safely and conveniently embark on their virtual currency investment journey and seize potential investment opportunities in 2025 and beyond.

Learn to easily copy Xiaohongshu copywriting! This tutorial teaches you step by step how to quickly copy Xiaohongshu video copy, saying goodbye to tedious steps. Open the Xiaohongshu APP, find the video you like, and click on the [Copywriting] area below the video. Long press the copy text and select the [Extract Text] function from the pop-up options. The system will automatically extract the text, click the [Copy] button in the lower left corner. Open WeChat or other applications, such as Moments, long press the input box, and select [Paste]. Click Send to complete the copy. It's that simple!
