手把手教您搭建Apache下的PHP环境
http://www.makaidong.com/%E5%8D%9A%E5%AE%A2%E5%9B%AD%E6%8E%A8%E8%8D%90/37371.shtml
http://httpd.apache.org/docs/2.4/platform/windows.html#winsvc
PHP 教程
http://www.w3school.com.cn/php/index.asp
http://www.kokojia.com/course-3553.html
微信开发教程 视频
http://study.163.com/course/courseMain.htm?courseId=1003067001#/courseDetail?tab=1
http://study.163.com/course/courseMain.htm?courseId=1003868040#/courseDetail?tab=1
通讯AES加密
https://www.cryptopp.com/wiki/Advanced_Encryption_Standard
https://www.cryptopp.com/wiki/TripleDES#Sample_Programs
微信加密sample
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1434696670
微信php代码示例
<?php
/**
* wechat php test
*/ //define your token
define("TOKEN", "weixin");
$wechatObj = new wechatCallbackapiTest();
$wechatObj->valid(); class wechatCallbackapiTest
{
public function valid()
{
$echoStr = $_GET["echostr"]; //valid signature , option
if($this->checkSignature()){
echo $echoStr;
exit;
}
} public function responseMsg()
{
//get post data, May be due to the different environments
$postStr = $GLOBALS["HTTP_RAW_POST_DATA"]; //extract post data
if (!empty($postStr)){ $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
$fromUsername = $postObj->FromUserName;
$toUsername = $postObj->ToUserName;
$keyword = trim($postObj->Content);
$time = time();
$textTpl = "<xml>
<ToUserName><![CDATA[%s]]></ToUserName>
<FromUserName><![CDATA[%s]]></FromUserName>
<CreateTime>%s</CreateTime>
<MsgType><![CDATA[%s]]></MsgType>
<Content><![CDATA[%s]]></Content>
<FuncFlag>0</FuncFlag>
</xml>";
if(!empty( $keyword ))
{
$msgType = "text";
$contentStr = "Welcome to wechat world!";
$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);
echo $resultStr;
}else{
echo "Input something...";
} }else {
echo "";
exit;
}
} private function checkSignature()
{
$signature = $_GET["signature"];
$timestamp = $_GET["timestamp"];
$nonce = $_GET["nonce"]; $token = TOKEN;
$tmpArr = array($token, $timestamp, $nonce);
sort($tmpArr);
$tmpStr = implode( $tmpArr );
$tmpStr = sha1( $tmpStr ); if( $tmpStr == $signature ){
return true;
}else{
return false;
}
}
} ?>