<?php
//外部调用第一个页面后,自动调转到该页面,由该页面实际完成调用应用的起始页面
include "wxid/wechat.class.php";
include 'wxid/errCode.php';
require_once("../Wx.Config.php");
$httppath = WxMainConfig::ServerHttpPath;

//$strselchid=trim($_REQUEST['chidno']);
//$chsel=trim($_REQUEST['chsel']);

$scope = 'snsapi_base';

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

$we = new Wechat($opt);
$auth = $we->checkAuth();
$arr = $we->getOauthAccessToken();
//echo $arr["access_token"];
//echo 'openid='.$arr["openid"];
//$bqurl='http://www.masbq.com:8080/bqmsy/index.php?bqudid='.$arr["openid"];
//$bqurl='http://aikehotel.com:8080/weixin/wxbooksk/hotelsel.php?chidno='.$strselchid.'&chsel='.$chsel.'&wxudid='.$arr["openid"];
$bqurl=$httppath.'wxbooksk/index2.php?wxudid='.$arr["openid"];
header('Location: ' . $bqurl);
//echo "<script>window.location.href='".$bqurl."';</script>";
?>