<?php
// Inialize session
session_start();
include('config.inc');
// Check, if username session is NOT set then this page will jump to login page
if (!isset($_SESSION['username'])) {
header('Location: index.php');
}
?>
<html>
<head>
<title>Secured Page</title>
</head>
<body>
<?php
$result = mysql_query("SELECT user.password, data1.dob FROM user INNER JOIN data1 ON user.username = data1.username WHERE username = '" . $_SESSION['username'] . "'");
echo "<table border='1'>
<tr>
<th>Name</th>
<th>Message</th>
</tr>";
while ($row = mysql_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['password'] . "</td>";
echo "<td>" . $row['dob'] . "</td>";
echo "</tr>";
}
echo "</table>";
?>
<p><a href="logout.php">Logout</a></p>
</body>
</html>
vibhaJ 126 Master Poster
karthik_ppts 81 Posting Pro
shyam2011 -1 Newbie Poster
shyam2011 -1 Newbie Poster
karthik_ppts 81 Posting Pro
shyam2011 -1 Newbie Poster
vibhaJ 126 Master Poster
karthik_ppts 81 Posting Pro
shyam2011 -1 Newbie Poster
vibhaJ 126 Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.