<?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/";
}

$scope = 'snsapi_base';

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

$we = new Wechat($opt);
$auth = $we->checkAuth();
$arr = $we->getOauthAccessToken();
//echo $arr["access_token"];
//echo 'openid='.$arr["openid"];
$oauth_url =  $we->getOauthRedirect($httppath.'start2.php?wxfw='.$strwxfwflag,"wxbase",$scope);

//echo $oauth_url;
//exit;
header('Location: ' . $oauth_url);
?>
