<?php
if (!empty($_POST)) {
if ($_POST['username'] == "") {
$message = "Please enter Username";
}else if ($_POST['password'] == "") {
$message = "Please enter Password";
} else {
require_once('UserAction/UserManager.php');
$userManager = UserManager::getInstance($_POST['username'], $_POST['password']);
$userResult = $userManager->userLogin();
if (count($userResult) == 0) {
$message = "Username/Password incorrect.";
} else {
$message = "Login successful";
}
}
}
?>
<html>
<head>
<title>User Login</title>
<link rel="STYLESHEET" type="text/css" href="./general.css">
</head>
<table width="60%" border="0" cellpadding="0" cellspacing="0"
align="center">
<tr>
<td align="center">
<form action="userLogin.php" method="post" name="loginForm">
<table border="0" align="center" width="400" cellspacing="2"
cellpadding="7" bgcolor="#f3f3f3">
<tr bgcolor="#587888">
<td colspan="2" bgcolor="#1A237D" align="center" class="subheading"
height="40"><b>User Login</b></td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2" align="left" class="normal"><font color=#FF0000>
<?php
if($message != "") {
echo $message;
}
?>
</font>
</td>
</tr>
<tr bgcolor="#ffffff">
<td class="normal">Username:</td>
<td><input class=button type="text" name="username" value=""></td>
</tr>
<tr bgcolor="#ffffff">
<td class="normal">Password:</td>
<td><input class=button type="Password" name="password" value=""></td>
</tr>
<tr bgcolor="#ffffff">
<td class="normal"> </td>
<td><input class=buttonadmin type="Submit" name="submit"
value="Sign In" class="buttonStyle"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</html>
|