Create Web Page

'; $htmlFooter = ' '; $loginForm = '


'; // Be sure to add the appropriately names form elements for pagename, contents, and color $logoutForm = '
'; if ($_SESSION['loggedIn']) { $message = 'Your are currently logged in'; if ($_POST['action'] == 'Logout') { $_SESSION['loggedIn'] = FALSE; session_destroy(); $message = 'You just logged out'; } else if ($_POST['action'] == 'Create Page') { createPage(); $message = 'You just created a new page'; } } else { $_SESSION['action'] = $_POST['action']; $_SESSION['userID'] = $_POST['userid']; $_SESSION['passWord'] = $_POST['passwd']; if ($_SESSION['action'] == "Login") { if($_SESSION['userID'] == "admin") { if($_SESSION['passWord'] == "test123") { $_SESSION['loggedIn'] = true; $message = 'You just logged in'; } else { $message = 'Incorrect password'; } } else { $message = 'Username not found'; } } else { $message = 'Welcome: please login to create a page'; } } if ($message != NULL) $message = '
'.$message.'
'; echo $htmlHeader; echo $message; if ($_SESSION['loggedIn']) echo $logoutForm; else echo $loginForm; echo $htmlFooter; ?>