assign("menu", $menu); if (!isset($_GET['page'])) $page = "index"; else $page = $_GET['page']; if (isset($page)) { $page = mysql_fetch_assoc(mysql_db_query(DBNAME, "select * from pages where linkname = '".$page."' limit 1")); $smarty->assign("page", $page); $smarty->display("page.tpl"); } else { $smarty->display("index.tpl"); } ?>