<?php
@define('WAP_CONTROL', TRUE);
define('D_BUG', '1');

//判断是不是通过手机访问
$is_wap = false;
if(isset($_SERVER['HTTP_VIA']))
{
	$is_wap=true;
}
elseif (isset($_SERVER['HTTP_ACCEPT']) &&
    (strpos($_SERVER['HTTP_ACCEPT'],'vnd.wap.wml')!==FALSE)
    && (strpos($_SERVER['HTTP_ACCEPT'],'text/html')===FALSE ||
    (strpos($_SERVER['HTTP_ACCEPT'],'vnd.wap.wml') <
        strpos($_SERVER['HTTP_ACCEPT'],'text/html'))
    )) {//手机访问
   $is_wap=true;
}

if($is_wap==false)
{
	include_once('./common.php');
	showmessage('这个页面只能用手机访问 ', 'index.php', 10);
	exit;
}

include_once('./wap/common.php');
//获取方法
$m_f = empty($_GET['m_f'])?'index':$_GET['m_f'];

//允许的方法
$fs = array('cp','space', 'do', 'index');
if(empty($m_f) || !in_array($m_f, $fs)) {
	showmessage('enter_the_space', 'index.php', 0);
}

include_once(WAP_ROOT.'./'.$m_f.'.php');
?>