printHeader("Title", "Keywords", "Description", "home"); ?> <div class="indexLeft"> <h2>Welcome to the alpha.</h2> <p class="largeText">This is the alpha prototype of GovDialogue—a simple, solid platform for government dialogues.</p> <p class="largeText">GovDialogue helps create conversations between governments and people. <a href="join.php">Test the prototype »</a> <div class="clearBoth"></div> </div><!-- /.indexLeft --> <div class="indexRight"> <?php if (isUserLoggedIn()) { print_greeting_box("indexLoginBox"); } else { print_login_box("indexLoginBox"); } ?> </div><!-- /.indexRight --> <div class="clearBoth"></div> </div><!-- /.contentBox --> <div class="contentBoxBottom"><img src="images/spacer.gif" width="1" height="1" border="0" /></div> <div class="contentBoxTop"><img src="images/spacer.gif" width="1" height="1" border="0" /></div> <div class="contentBox">
printHeader("Login", "Keywords", "Description", "login"); if (isset($_SESSION['user'])) { // If session is set, user is logged in echo "Logged in as " . $user_firstname; } else { // Check if form has been submitted if (isset($_POST['email'])) { // Form has been submitted // Validate fields // Username and password missing if (strlen($_POST['email']) <= 0 || strlen($_POST['password']) <= 0) { echo "Missing information!"; } else { if (login($_POST['email'], $_POST['password'])) { $domain = $_SERVER['HTTP_HOST']; echo "Login successful."; //header("Location: http://$domain/alpha/index.php"); //exit(); relative_redirect("index.php"); } else { echo "The email address and password you entered don't match our records. Please go back and try again."; } } } else { // No form has been submitted // So, display login form print_login_box("loginpage"); } } require_once "footer.php"; ob_flush();