I am trying to create a new login page and only redirect a person if they are not logged in. Otherwise, I'd like the script to basically end. However, I don't know how to check the password. Since it is encrytped in the db. How can I un-encrypt the password and check it? Here's the code...
<?
session_start(); // start session.
?>
<html>
<body bgcolor="black"><font color="white">
<?
if(!isset($username) | !isset($password)) {
// escape from php mode.
?>
<form action="<?=$PHP_SELF?><?if($QUERY_STRING){ echo"?". $QUERY_STRING;}?>" method="POST">
<p align="center">Only Refs Allowed Beyond This Point. Please login to proceed.</p>
<table align="center" border="0">
<tr>
<th><font color="white">
Username:
</th>
<th>
<input type="text" name="username">
</th>
</tr>
<tr>
<th><font color="white">
Password:
</th>
<th>
<input type="password" name="password">
</th>
</tr>
<tr>
<th colspan="2" align="right">
<input type="image" src="login.bmp"><br>
<a href="fpass.php"><IMG alt="blank" src="login.bmp"></IMG>
</form>
</th>
</tr>
</table>
</body>
</html>
<?
exit();
}
?>