Skip to content
Find file
6cc9e4a Dec 10, 2010
41 lines (37 sloc) 1.75 KB
require 'includes/';
if($Auth->loggedIn()) redirect(WEB_ROOT);
if($Auth->login($_POST['username'], $_POST['password']))
if(isset($_REQUEST['r']) && strlen($_REQUEST['r']) > 0)
$Error->add('username', "We're sorry, you have entered an incorrect username and password. Please try again.");
// Clean the submitted username before redisplaying it.
$username = isset($_POST['username']) ? htmlspecialchars($_POST['username']) : '';
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Sample Login Page</title>
<link rel="stylesheet" type="text/css" href="">
<link rel="stylesheet" type="text/css" href="">
<form action="<?PHP echo $_SERVER['PHP_SELF']; ?>" method="post">
<?PHP echo $Error; ?>
<p><label for="username">Username:</label> <input type="text" name="username" value="<?PHP echo $username;?>" id="username" /></p>
<p><label for="password">Password:</label> <input type="password" name="password" value="" id="password" /></p>
<p><input type="submit" name="btnlogin" value="Login" id="btnlogin" /></p>
<input type="hidden" name="r" value="<?PHP echo htmlspecialchars(@$_REQUEST['r']); ?>" id="r">
Something went wrong with that request. Please try again.