检测微信用户是否已经关注此公共平台

<?php
require_once("../includes/conn.php");
require_once("../includes/wxtoken.php");
$tools=new tools();
if(!$tools->check_is_weixin()){
    header("Location:guanzhu.php");
    exit;
}
$wxtoken = new wxtoken();
$signPackage = $wxtoken->GetSignPackage();

$sysconfig=mysql_fetch_array(mysql_query("select * from ".DBQIAN."sys_config order by id desc limit 1"));
$hongbaorow=$dbconn->fetch($dbconn->query("select hfaci from ".DBQIAN."xianjin_set order by id desc limit 1"));
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
<title><?php echo iconv("GBK","UTF-8",$sysconfig['cwxname']);?></title>
<style>
body { background-color:#fcc803; margin:0px; padding:0px; font: 14px Verdana, Arial, Helvetica, sans-serif; color:#7a6100 }
.tips { width:100px; height:42px; background:url(../images/tips.jpg) no-repeat; line-height:42px; color:#fff; font-weight:bold; text-indent:1em }
.row { width:100%; margin:10px 0px; padding:0px; }
.text-center { text-align:center }
</style>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
  wx.config({   
    debug: false,
    appId: '<?php echo $signPackage["appId"];?>',
    timestamp: <?php echo $signPackage["timestamp"];?>,
    nonceStr: '<?php echo $signPackage["nonceStr"];?>',
    signature: '<?php echo $signPackage["signature"];?>',
    jsApiList: [
        'checkJsApi',
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
        'hideMenuItems',
        'showMenuItems',
        'hideAllNonBaseMenuItem',
        'showAllNonBaseMenuItem',
        'translateVoice',
        'startRecord',
        'stopRecord',
        'onRecordEnd',
        'playVoice',
        'pauseVoice',
        'stopVoice',
        'uploadVoice',
        'downloadVoice',
        'chooseImage',
        'previewImage',
        'uploadImage',
        'downloadImage',
        'getNetworkType',
        'openLocation',
        'getLocation',
        'hideOptionMenu',
        'showOptionMenu',
        'closeWindow',
        'scanQRCode',
        'chooseWXPay',
        'openProductSpecificView',
        'addCard',
        'chooseCard',
        'openCard'
    ]
  });
wx.ready(function () {
    wx.hideOptionMenu();
});
</script>
</head>
<body>
<div class="row">
  <div class="tips">第一步</div>
</div>
<div class="row text-center"> <img src="http://open.weixin.qq.com/qr/code/?username=<?php echo $sysconfig['cwxzhanghao'];?>" width="180"/> </div>
<div class="row text-center" >
  <div style="font-size:22px;color:#fff;font-weight:bold;line-height:40px;color:#fa3137">"长按图片,识别图中二维码"</div>
  <div style="line-height:30px;"> 如长按图片无效,搜索以下微信号关注即可 </div>
  <div style="font-size:28px;font-weight:bold;line-height:60px;color:#000000"><span style="border:1px dashed #000000;padding:5px 10px"><?php echo $sysconfig['cwxzhanghao'];?></span></div>
  <div style="line-height:30px;">长按虚线框,拷贝微信号</div>
</div>
<div class="row">
  <div class="tips">第二步</div>
</div>
<div class="row text-center" >
  <div style="font-size:22px;color:#fff;font-weight:bold;line-height:40px;color:#fa3137">发送"<?php echo iconv("GBK","UTF-8",$hongbaorow['hfaci']);?>"给公众号</div>
  <div style="line-height:30px;">点击图文消息,给朋友</div>
  <div style="line-height:30px;">每多一个朋友成功领取,你也会再得到一个!</div>
</div>
</body>
</html>

请结合我之前教程进行参考,学习。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值