Forum Moderators: coopster
Below is a snippet of my "login.php" script. This script is called by an html form where users enter their username and password. If the login is successful the user is redirected to the "loggedin.php".
if($row['admin_access'] == 1){
$_SESSION['admin_access'] = true;
}
$login_time = mysql_query("UPDATE members
SET last_login=now()
WHERE id='{$row['id']}'");
}
header("Location: loggedin.php");
Below is a snippet of my "loggedin.php" script where i output: $_SESSION['first_name']
<p><font size="4" face="verdana, arial, helvetica">Welcome<?=$_SESSION['first_name'];?>!</font></p>
<p><font size="2" face="verdana, arial, helvetica">You have successfully logged in!</font></p>
<p><font size="2" face="verdana, arial, helvetica"><a href="logout.php">logout</font></p>
The problem is $_SESSION['first_name'] is not getting displayed in loggedin.php. However if i use
include 'loggedin.php'; instead of
header("Location: loggedin.php"); in my login.php file it works.
I hope this make sense. Thank you.