My intention here is to have a user login using a user id and pw, then have their data from the table display. I've tried several things. The closest I got was this...except the table entry doesn't show. When I tinkered with it and simply selected all the records, everything but the earlier record entered displayed. Anyone have any ideas?
The other thing I tried was having this page forward to another page that selected records from a different table that just contained the pertinent data. Still, I can't quite get it.
Thanks.
<?
$dbconnect = mysql_connect("localhost","mfmgmt","stoneham");
mysql_select_db("mfmgmt");
$user_password=$POST["user_password"];
$user_id=$POST["user_id"];
$query = "SELECT * from logins where id = '$user_id' AND password = '$user_password' ";
if (!$result = mysql_query($query,$dbconnect))
{
echo mysql_error();
exit;
}
if($row = mysql_fetch_row($result))
{
print"<div id='main'><h1>Welcome</h1><br>";
?>
<table width="100%" border=0 align=center class="copy">
<tr>
<th width="160">Client</th>
<th width="140">Default Letter</th>
<th width="140">Order of Notice</th>
<th width="140">Document 3</th>
<th width="140">Document 4</th>
</tr>
<?
while($row = mysql_fetch_row($result))
{
?>
<tr>
<td><?=$row[0]?></td>
<td><?=$row[5]?></td>
<td><?=$row[6]?></td>
<td><?=$row[7]?></td>
<td><?=$row[8]?></td>
</tr>
<?
}
?>
</table>
<br></div>
<?
}
else
{
print"<div id='mainl'><h1>Client Area</h1><br><br><br><br><br><br><br>
Sorry, you have entered incorrect login information. Please note that the password is case sensitive. To try again, <a href='login.php'>click here</a> or <a href='mailto:xxxxxx'>contact us</a> for assistance.<br><br><br><br><br><br><br><br><br></div>";
}
?>