一、申请微信测试公众帐号:
1.微信公众平台测试好申请地址:http://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login
点击登录,跳出一下界面:
使用自己的微信号扫描登录,就申请成功一个测试公众号:
二、环境和公众号的配合使用:
1.在你的服务器web路径下,新建一个index.php文件(用于配置开发着信息):
TOKEN值自己定,需要和公众号接口配置中的TOKEN值相同;
<?php
/*
@author:J.wen
*/
define("TOKEN", "weixin");
$echoStr = $_GET["echostr"];
$signature = $_GET["signature"];
$timestamp = $_GET["timestamp"];
$nonce = $_GET["nonce"];
$token = TOKEN;
$tmpArr = array($token, $timestamp, $nonce);
sort($tmpArr, SORT_STRING);
$tmpStr = implode($tmpArr);
$tmpStr = sha1($tmpStr);
if($tmpStr == $signature){
echo $echoStr;
exit;
}
?>
2.在开发者的基础配置下,或测试公众号的接口配置信息中填写你的服务器URL和TOKEN值;