Ive got a website with login page and i want the members to have thier own profile page. Here is the code i got now:
<?
session_start();
$user = $_SESSION['username'];
echo "User online - ".$_SESSION['username']."";
echo "<br>";
echo "User - $user";
echo "<br>";
if ($u)
{
$result = mysql_query("Select * from users WHERE username='$u' ",$con);
$num = mysql_num_rows($result);
$n = 0;
?>
<table>
<tr >
<td>Username</td>
<td>Name</td>
<td>Email</td>
</tr>
<?
while($row= mysql_fetch_array($result , MYSQL_ASSOC))
{
?>
<td><? echo $row['username']; ?></td>
<td><? echo $row['name']; ?></td>
<td><? echo $row['email']; ?></td>
<?
}
}
else
{
?>
<a href="show_profile.php?u=<? echo $user; ?>">Show profile</a>
<?
}
?>
I want the members to view each others profile pages.