function index() { //判断是否登录; if (@$_COOKIE["adminname"] == "") { global $CONF; $tpl = new Smarty; $tpl->assign('title', $CONF['sys_name']); $tpl->assign('STATIC', 'static/news/'); $tpl->display('./' . DASH_BOARD . '/view/login.html'); } else { redirect('news.php?m=News&a=index'); } }
Done!