www.gusucode.com > Destoon B2B仿淘宝电子商务网站 UTF8 v6.0源码程序 > destoon/api/weixin/qrcode_sign.php

    <?php
require '../../common.inc.php';
header("Content-type:image/png");
$_userid or dheader('image/qrcode_error.png');
$auth = isset($auth) ? decrypt($auth) : '';
$auth == $_username.md5(DT_IP.$_SERVER['HTTP_USER_AGENT']) or dheader('image/qrcode_error.png');
$t = $db->get_one("SELECT itemid FROM {$DT_PRE}weixin_user WHERE username='$_username'");
$t or dheader('image/qrcode_error.png');
require DT_ROOT.'/api/weixin/init.inc.php';
$url = 'https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token='.$access_token;
$par = '{"action_name": "QR_LIMIT_SCENE","action_info": {"scene": {"scene_id":99999}}}';
$arr = $wx->http_post($url, $par);
dheader('https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket='.urlencode($arr['ticket']));
?>