Location: PHPKode > projects > Apartment Classfieds > apartment_classifieds_script/admin_login.php
<?php
require_once('class_page.php');
require_once('globals.php');

session_start();

$page = new Page();
$page->append_title('Administrator Login');

if (isset($_POST['password']))
{
	if ($_POST['password'] == ADMIN_PASSWORD)
	{
		$_SESSION['admin'] = true;
		$page->append_content('You have been logged in, you can now browse apartments and delete
		them using the DELETE POST link at the bottom of the page.');
	}
	else
	{
		$page->append_content('Incorrect admin password, please <a href="admin_login.php">try again</a>.');
	}
}
else
{
	$page->append_content('<form action="admin_login.php" method="POST">
		Password: <input type="password" name="password">
		<input type="submit" name="submit" value="Login"></form>');
}

$page->display();
?>
Return current item: Apartment Classfieds