Wednesday, April 13, 2011

I used this code to determined the name of the user that login in my page or if its a guest only.


<?php     
if(isset($_SESSION['fname']))

{

echo '<font face="Tahoma" size="1" color="black"><B>Welcome,&nbsp; '.$_SESSION['fname'].'&nbsp;|</B></font>&nbsp; ';
echo'<font face="Tahoma" size="1" color="black"><a href="destroysession.php" ><B>Log out</B></a></font>';
}
else
{
echo'<font face="Tahoma" size="1" color="black"><B>Welcome, Guest</B></font>';
echo'<font face="Tahoma" size="1" color="black">&nbsp;|&nbsp;<a href="reg.php"><B>Register</B></a></font>';

}
?>

No comments:

Post a Comment