<---snippet
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="container">
<div id="top">
<h1>header</h1>
</div> <div id="leftnav"> <p>
<?php
$username=$_POST['username'];
$password=$_POST['password'];
$db="user";
$server="localhost";
$db_username="root";
$db_password="*******";
$connect = mysql_connect($server,$db_username,$db_password);
if (!$connect) {
die ("could not connect to database");
}
$select = mysql_select_db($db,$connect);
if (!$select) {
die ("could not select database $db");
}
/*username='$username'";*/
$sql = "SELECT * FROM passwords, user_info where id=PID and username='$username'";
$result = mysql_query($sql);
/*$num_rows = mysql_num_rows($result);*/
while ($user = mysql_fetch_array($result))
{
$id = $user['id'];
$username2 = $user['username'];
$password2 = $user['password'];
$firstname = $user['firstname'];
$email = $user['email_address'];
IF ($username=="$username2" && $password=="$password2")
{
echo("\"Welcome, <b>$firstname</b>\"");?><br><?
echo ("\"Your email address is <b>$email<b>\"");?></td><tr>
<a href="<?$_SERVER['PHP_SELF']?>?username=""&?password=""">Logoff</a><?
break;
}
else
{
?>
<FORM action="<?$_SERVER['PHP_SELF']?>" method="post">
<INPUT type="hidden" name="id">
<table>
<td><b>*</b>Username:</td> <td><INPUT class="input" size="8" type="text" name="username" value="<?echo $username?>"></td><tr>
<td><b>*</b>Password:</td> <td><INPUT class="input" size="8" type="password" name="password"></td><tr>
<td class="xsmall"><b>* Case Sensitive</b></td>
<td><INPUT type="submit" value="Login"></td><tr>
<td>  </td>
</table>
</FORM>
<?
break;
}
}
//IF ($username != $username2 || $password != $password2) {//
?><br> <? if ($username == "" && $password == "") { echo ("Please type in a Username and Password");}
if ($username != "" && $password == "") { echo ("Please type in a password");}
if ($username == "" && $password != "") {
echo ("Please type in a username and password");}
?>
</p>
</div>
<?if (($username2==$username && $password2==$password) && ($username2!="" || $password2!="")){?>
<div id="rightnav" class="box">
<p>
</p>
</div>
<?}?>
<div id="content">
<h2>Subheading</h2>
<p>
</p>
<p>
</p>
</div>
<div id="footer">
<p>
Today is
<?php
echo( date("F dS Y."));
?>
</p>
</div>
</div>
</body>
</html>
---->snippet
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php