微信token验证代码
2015-11-14 10:36
597 查看
<?php /** * wechat php test */ //define your token define("TOKEN", "weixin"); $signature = $_GET['signature']; $timestamp = $_GET['timestamp']; $nonce = $_GET['nonce']; $echostr = $_GET['echostr']; $token = TOKEN; $tmpArr = array($token, $timestamp, $nonce); sort($tmpArr, SORT_STRING); $tmpStr = implode( $tmpArr ); $tmpStr = sha1( $tmpStr ); if( $tmpStr == $signature ){ //没加这一句一直token验证失败 header('content-type:text'); echo $echostr; } ?>
相关文章推荐
- 微信公众号开发API接口大全
- 为什么企业微信公众号都流行做二次开发?
- PHP常用的小程序代码段
- Java五子棋控制台小程序
- 微信在未来智能家居中竟然可以这样用?
- 曾推动微信运动成为潮流的乐心,想要用小米模式跟传统医疗说不
- 动手动脑之小程序:TryAndCatch
- 高仿微信短视频拍摄功能的demo下载
- 025.ArrayList中的方法.续
- 微信支付中xml和map互转
- 微信公众平台开发 - OAuth2.0网页授权
- 微信语音输入不仅仅是懒癌患者的福音
- 微信支付(不得不吐槽腾讯这个坑货)
- 微信jssdk录音功能开发记录
- iOS微信支付流程及实现
- ios开发笔记-3-微信支付
- 线程(售票小程序)
- 用chrome模拟微信浏览器访问需要OAuth2.0网页授权的页面
- android微信支付(问题总结)
- 在网页中添加分享到微信、QQ、微博