微信开发返回验证来源方式代码

<?php
$xml = simplexml_load_string($GLOBALS['HTTP_RAW_POST_DATA']);
$arr = array( 'appid'=> (string)$xml->AppId, 'appkey'=>$appkey, 'issubscribe'=> (string)$xml->IsSubscribe, 'noncestr'=> (string)$xml->NonceStr, 'openid'=> (string)$xml->OpenId, 'timestamp'=> (string)$xml->TimeStamp ); $sign = sha1( http_build_query($arr) ); if( $sign == $xml->AppSignature){ echo "success"; } ?>

 

posted @ 2014-02-12 09:12  ﹏Sakura  阅读(437)  评论(0编辑  收藏  举报