<?php
//外部调用第一个页面后,自动调转到该页面,由该页面实际完成调用应用的起始页面
include "wxid/wechat.class.php";
include 'wxid/errCode.php';

$strwxfwflag=trim($_REQUEST['wxfw']);
if($strwxfwflag=="1")
{
	$httppath = "http://hotel.yuanxusoft.cn/weixin/wxydt/";
}
else
{
	$httppath = "https://hotel.yuanxusoft.cn/weixin/wxydt/";
}

$opt = array(
	'appsecret'=>'fbda078dddbfa0facdc70f0a9d8e9e49',//填写高级调用功能的密钥
	'appid'=>'wx3a8dd150df24038d'	//填写高级调用功能的appid
);

$we = new Wechat($opt);
$auth = $we->checkAuth();
$arr = $we->getOauthAccessToken();

$bqurl=$httppath.'main.php?wxudid='.$arr["openid"].'&wxfw='.$strwxfwflag;

header('Location: ' . $bqurl);

?>