hi guys, im having a bit of trouble displaying the username in the html header after authentication. This is my HTML header function:
function do_html_header()
{
// print an HTML header
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title><?php echo $title;?></title>
<style>
h1{text-align:center; color:#CC0000; }
p{text-align: center;}
body{background-color: #CCCCCC;}
tr#row1{background: #FFFFFF;}
a{text-decoration: none; color:#000000; }
</style>
</head>
<table align="center">
<tr>
<td><img src="images/logo.gif" /></td>
</tr>
<tr id="row1">
<td align="right">
<?php
if (isset($HTTP_SESSION_VARS['valid_user']))
{
echo "Logged in as ".$HTTP_SESSION_VARS['valid_user']."";
}
else
{
echo "<a href=\"login.php\">Members Login Here</a>";
}
?>
</td>
</tr>
</table>
<?php
};
now for some reason it just displays 'members login here' even after the user has logged in. Ive used this if statement to dispaly certain things to members and other to non members which works but i have no idea why this doesnt. It should be shown throughout my site.
Any help would be appreciated
NCC1701