Any particular reason that you're using $HTTP_SESSION_VARS instead of the newer $_SESSION equivalent? If your PHP is too old to support $_SESSION, then you really should either upgrade or petition your admin to upgrade.
Having said that if PHP is new enough to support the $_SESSION superglobal, use that instead and your script should work. If PHP is too old and you cannot upgrade, use session_register to create the session variable and $HTTP_SESSION_VARS to check a value.
Code:
//This code is on top of the checking users on my template.
if ($HTTP_SESSION_VARS['valid_user'])
{
echo '<a href="logout">logout</a>';
}
else
{
echo '<a href="loggin">login</a>';
}
//this code is after when i check user for valid pass and username
session_register('username');
http://www.php.net/session_register.
If you have a newer version of PHP, all you have to do is use the $_SESSION superglobal. This is the current practice and the best way to go.
Code:
//This code is on top of the checking users on my template.
if ($_SESSION['valid_user'])
{
echo '<a href="logout">logout</a>';
}
else
{
echo '<a href="loggin">login</a>';
}
//thise code is after when i check user for valid pass and username
$_SESSION['valid_user'] = $username;
HTH!
Regards,
Rich
--
[
http://www.smilingsouls.net]
[
http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail