/** * grab parms from URL * */ parse_str($_SERVER['QUERY_STRING']); /** * some settings * */ isset($page) || $page = "home"; // default page to show if (!preg_match("/^[a-zA-Z0-9_\-]+$/", $page)) { $page = "home"; } $page_directory = "pages"; // directory with pages $page_current = "$page_directory/$page.php"; /** * Login * */ session_start(); if(isset($_POST['username']) and isset($_POST['password'])) { $user = $_POST['username']; $pass = $_POST['password']; if($user == $pass) { $_SESSION['user'] = $user; $_SESSION['logged_in'] = true; } } /** * Prepare links */ $spath = dirname($_SERVER['SCRIPT_NAME']); if(strlen($spath) < 2) $spath = ""; ?>