<?php
//link to the related librairy and the set functions
require_once '../library/config.php';
require_once '../library/functions.php';
//If errors:
$error_message = '';
if (isset($_POST['user_name'])) {
if ($_POST['user_name'] == 'books' && $_POST['password'] == 'insects') {
$_SESSION['islogged'] = true;
header('Location:indexoo.php');
exit;
}
else {
$error_message = "The entered user name or password are not correct ..";
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Login Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../css/styles.css" />
<style type=text/css></style>
</head>
<body>
<center>
<img src = "books.jpg">
<br />
<br />
<br />
<form action="" method="post" name="log_example" id="log_example">
<table class = "principal">
<tr>
<td>User name</td>
<td><input size="35" maxlength="255" name="user_name" type="text" id="user_name" value="books"></td>
</tr>
<tr>
<td>Password</td>
<td><input size="35" maxlength="255" name="password" type="password" id="password" value="insects"></td>
</tr>
<tr>
<td> </td>
<td><input size="35" maxlength="255" type="submit" name="Submit" value="Log in">
</td>
</tr>
</table>
</form>
<?php
// if an error occurs:
if ($error_message != '') {
echo '<p align="center"><font color="#8B008B">' . $error_message . '</font></p>';
}
?>
</center>
</body>
</html>