I'm trying, I really am. But still, it's not working. Here's the code for the page that displays after the user logs in correctly, with data from the logins table.
<?
session_start();
$_SESSION['user_id'] = $user_id;
?>
<html>
<head>
</head>
<body>
<?
$dbconnect = mysql_connect("localhost","mfmgmt","stoneham");
mysql_select_db("mfmgmt");
$user_password=$_POST["user_password"];
$query = "SELECT * from logins where id = '$user_id' AND password = '$user_password' ";
$result = mysql_query($query,$dbconnect);
if($row = mysql_fetch_row($result))
{
print"<div id='main' class='copy'><h1>Welcome to the Client Only Area</h1>";
print"<span class='copy'>Client Account</span><br><br><a href='properties-a.php'>View My Property Details</a>";
}
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>";
}
?>
</body>
</html>
And here is the code for the following page that uses the var $user_id to pull relevant data from the other table.
<?php
session_start();
$_SESSION['user_id'] = $user_id;
$user_id = $_SESSION['user_id'];
?>
<html>
<head>
</head>
<body>
<?
$dbconnect = mysql_connect("localhost","xxx","xxx");
mysql_select_db("xxx");
$query = "SELECT * from properties where id = '$user_id' ";
$result = mysql_query($query,$dbconnect);
?>
<table width="100%" border=0 align=center class="copy">
<tr>
<th width="160">Client</th>
<th width="140">Doc 1</th>
<th width="140">Doc 2</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[1]?></td>
<td><?=$row[2]?></td>
<td><?=$row[3]?></td>
<td><?=$row[4]?></td>
</tr>
<?
}
?>
</table>
</body>
</html>
So, I think I've been following all of your helpful instructions, but it's not working. Do you see anything I've missed? I really appreciate all the help.
Thanks.