微信网页扫二维码带参数

时间:2019-08-05 15:53:46   收藏:0   阅读:176

public function index(){
  $postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
  $postObj = simplexml_load_string($postStr, ‘SimpleXMLElement‘, LIBXML_NOCDATA);
  $toUsername = $postObj->ToUserName;//公众号的微信号
  $fromUsername = $postObj->FromUserName;//用户的微信号
  $MsgType = $postObj->MsgType;//消息类型
  $Event = $postObj->Event;//事件类型 首次关注=subscribe 已关注 SCAN
  $EventKey = $postObj->EventKey;//事件key值
  file_put_contents(‘weixinv.txt‘, ‘公众号微信号=‘.$toUsername.‘ 用户公众号=‘.$fromUsername.‘ 消息类型=‘.$MsgType.‘ 事件类型=‘.$Event.‘ 事件key值=‘.$EventKey,FILE_APPEND);

 


  exit(htmlspecialchars($_GET[‘echostr‘]));

}

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!