function check_page(){ $smarty = new Smarty(); switch($_GET['do']){ case 'register': $smarty->assign('ip', $_SERVER['REMOTE_ADDR']); $smarty->display('register.tpl'); break; case 'support': $smarty->display('support.tpl'); break; case 'about': $smarty->display('about.tpl'); break; case 'login': $smarty->display('login.tpl'); break; default: $smarty->display('main.tpl'); } }