0

Thanks This Is The Final Working Code

<?
if(isset($_SESSION['username']))
{
    $query = ("SELECT * FROM users WHERE password='$_SESSION[password]'");
    $result = mysql_query($query);
    while($row = mysql_fetch_array($result))
   {
    echo "Welcome<br/>";
    echo "Your Username : $row[username]<br/>";
    echo "Your Password Is : $_SESSION[password]<br/>";
    echo "Your Email : $row[email]";
    }

}else{
 
echo "<img src='Zimg/Login.Png' alt='Login' /><br/><br/>";
echo "Reg Plz";
echo "<META HTTP-EQUIV='refresh' CONTENT='2; URL=index.php'>";
 
}
?>
 
</div>

Thanks For Everyone Helped Me :)

0

The guest thing is a bit strange as it must be coming from somewhere I think.

To show all fields for a member try the following code, assuming that the id field is called 'id'. If it does not work, could you post your table fields please.

Note that this will only (if it works) show the username and id. If it works, the other fields can be added afterwards.

<?
if(isset($_SESSION['username']))
{
echo "<div id='User'>Welcome : " . $_SESSION['username'] . " </div>";
echo "<div id='User'>Your ID : " . $_SESSION['id'] . " </div>";

$sessuser = $_SESSION['username'];
$userquery = "SELECT * FROM users WHERE username='".$sessuser."'";
$userresult = mysql_query($userquery);
while($userrow = mysql_fetch_array($userresult))
 {
    echo $userrow ['username'].", ".$userrow ['id']; 
}else{
 
echo "<img src='Zimg/Login.Png' alt='Login' /><br/><br/>";
echo "Reg Plz";
echo "<META HTTP-EQUIV='refresh' CONTENT='2; URL=index.php'>";
 
}
?>

Thanks So Much For You

You Really Helped Me Too Much I Dont Know What To Say

Thanks Is Not Enough

I Wish You A Good Day Sir

And Its Solved :)

0

Can I just make one more suggestion.

With the 'WHERE' clause in the query set to 'password', there could be more than one person with the same password.
If you set it to the 'id' field, this should be unique and only ever show 1 user.

Glad it is working!
Steve

0

Can I just make one more suggestion.

With the 'WHERE' clause in the query set to 'password', there could be more than one person with the same password.
If you set it to the 'id' field, this should be unique and only ever show 1 user.

Glad it is working!
Steve

As I Mentioned Before :)

You Are Amazing

Thanks So Much And I Really Forget That

Thanks Thanks Thanks

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.