Location: PHPKode > scripts > wwdbank > wwdbank/accounts/messageread1.php
<?php
Include_once('includes/session_config.php');
echo"<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
$user_name=($_SESSION['user_name']);

$query="SELECT *,DATE_FORMAT(date, '%D %M, %Y') AS date FROM messaging WHERE to_user='$user_name'";
$result=mysql_query($query);
$number=mysql_num_rows($result);
if ($number == 0)
{
echo "<tr valign=\"top\"><td colspan=\"4\">You have no messages.</td></tr>";
}
else
{
echo"<tr valign=\"top\"><td colspan=\"4\"><b>Here are your messages:</b></td></tr>";
echo"<tr valign=\"top\"><td colspan=\"4\" height=\"20\"></td></tr>";

while ($row = mysql_fetch_array($result))
 	{
	echo"<form name=\"form\" action=\"$PHP_SELF?\" method=\"post\">
		<input type= \"hidden\" name= \"messageread1\" value= \"messageread1\" >
		<input type= \"hidden\" name= \"messaging\" value= \"messaging\" >
		<input type= \"hidden\" name= \"admin\" value= \"admin\" >
		<input type= \"hidden\" name= \"user_name\" value= \"{$_SESSION['user_name']}\" >
		<input type=\"hidden\" name=\"pass\" value=\"{$_SESSION['pass']}\">
		<input type= \"hidden\" name= \"submit\" value= \"submit\" >
		<input type= \"hidden\" name= \"message_id\" value= \"{$row['message_id']}\" >";
	echo"<tr><td width=\"40\">
	<INPUT TYPE=\"image\" SRC=\"../images/read.jpg\" width=\"30\" height=\"12\"  alt=\"Read\" BORDER=\"0\"></form></td>";
	echo"<td>{$row['title']}</td>";
	echo"<td>From {$row['from_user']}</td>";
	echo"<td>Date sent: {$row['date']}</td></tr>";
	echo"<tr><td colspan=\"4\" height=\"2\"></td></tr>";
	}
}
echo "</table>";
?>
Return current item: wwdbank