Ok so I have a login page which actually gets an employees ID and password and includes the employee id and surname+firstname in a session. Now in the following page:
<?php
require_once("nocache.php");
session_start();
if (!$_SESSION["who"])
{
header("location: logoff.php");
}
else
{
$emp = $_SESSION["who"];
$sn=$_SESSION["surname"];
$fn=$_SESSION["firstname"];
}
require_once("dbconn.php");
$sql="SELECT reviewYear,datecompleted,completed FROM reviews WHERE reviews.empid='$emp'";
$rs = mysql_query($sql, $dbConn);
?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title> Review</title>
</head>
<body>
<h1>Review Page</h1>
<p>
<h3>Welcome to the Review Page <?php echo $fn;?> <?php echo $sn;?> (<?php echo $emp; ?>)</h3>
<?php
while ($row = mysql_fetch_array($rs)) { ?>
<h4>Date Completed:</h4>
<?php echo $row["datecompleted"]?>
<h4>Review Year</h4>
<?php echo $row["reviewYear"]?>
<h4>Completed</h4>
<?php echo $row["completed"]?>
<?php }; ?>
<br/>
<a href="logoff.php">Log Off</a><br/>
</p>
</body>
</html>
Im trying to get the page to show the details i.ereviewYear,datecompleted,completed from the reviews table for the logged in user.I tried doing an sql statement,but i doesnt work.Could someone please help me out?:(