Sindbad~EG File Manager
<?php
session_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Returning User Login</title>
</head>
<body BGCOLOR="#ffffcc">
<div align="center"> <h1>Returning User </h1>
</div>
<P>
<p>
<P>
</P>
<?php
$Username = trim($_POST['Username']);
$Password = trim($_POST['Password']);
$Tried = ! is_null($_POST['Password']);
if($Tried)
{ require_once('DB.php');
require_once('query.php');
$sql = "SELECT * FROM People WHERE Username = '$Username' AND Password = '$Password';";
$d = Query($sql);
if($d->numRows() == 0)
$state = "Unauthorized";
else
$state = "Authorized";
}
else
$state = "Unauthorized";
if($Tried && $state != "Authorized")
print(" <P> <em><font color=\"#FF0000\">Your username and password were not recognized. Check the spelling. </font></em></P>");
else if($Tried)
print("<P>Your login was successful. Click one of the following links to proceed. </P>");
if($state != "Authorized")
{
?>
<P><EM> Enter your username and password, then click Submit.
</EM></P>
<P align="center">
<FORM action= "<?php echo $_SERVER['PHP_SELF'] ?>" method="POST">
<TABLE WIDTH="211" height="50" BORDER="0" CELLPADDING="1" CELLSPACING="1" id="TABLE2">
<TR>
<TD width="97">User name </TD>
<TD>
<INPUT id="Username" type="text" size="18" name="Username" value = "<?php echo $Username ?>" /></TD>
</TR>
<TR>
<TD>Password </TD>
<TD width="129">
<INPUT id="Password" type="password" size="18" name="Password"/></TD>
</TR>
</TABLE>
<P align="center">
<INPUT id="Submit" type="submit" value="Submit" name="Submit"></P>
<P>Forgot your username or password? <A href="ForgottenPassword.php">Click here</A></P>
</FORM>
<?php
} // if state != "Authorized"
else {
?>
<P> <A href="UploadRecipe.php?<?php echo "Username=$Username"?>">Post recipes </A></P>
<P> <A href="search.php"> </A><A href="BrowseRecipes.php">View or search recipes.</A></P>
<P> <A href="BrowseRecipes.php?<?php echo "Username=$Username"?>">View, edit, or delete recipes I have posted.</A></P>
<p> To edit or delete, you will first view the recipe and then press the edit button or the delete button at the bottom of the recipe.</p>
<?php
}
?>
</P>
</body>
</html>
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists