Hi there,
I'm currently working on a user login script. I'm using session
variables. Everything seems to be working fine but I continually get the
following warning message when I run the programs:
Warning: Cannot send session cache limiter - headers already sent
(output started at c:\phpdev\www\staffdb2\side_menu.php:3) in
c:\phpdev\www\staffdb2\side_menu.php on line 4
The side_menu.php routine is below:
<LINK REL=STYLESHEET HREF="styles.css" TYPE="text/css">
<BODY class="sidebar">
<?PHP
session_start();
//require_once('user_auth_fns.php');
//check_valid_user();
if (isset($HTTP_SESSION_VARS['valid_user']))
{
echo '<a href="logout.php">Log out</a>';
}
else
{
echo 'You are not logged in';
}
?>
The session variable 'valid_user' is set in the following routine:
<?PHP
require_once('staffdb_fns.php');
session_start();
$username=$HTTP_POST_VARS['username'];
$passwrd=$HTTP_POST_VARS['passwrd'];
if ($username && $passwrd)
{
if (login($username,$passwrd))
{
$HTTP_SESSION_VARS['valid_user']=$username;
display_page_layout();
}
else
{
echo 'login failed';
display_login_form();
exit;
}
}
else
{
display_login_form();
}
//check_valid_user();
?>
Any ideas.
PS : I am rather new to php so be kind please.
Regards,
Steve.