thats pretty much a golden rule of sessions =) -----Original Message----- From: Veniamin Goldin [mailto:[EMAIL PROTECTED] Sent: Friday, October 03, 2003 12:41 PM To: STONE Steven Cc: php mailing list Subject: Re: [PHP] session control query
Hi, session_start(); must be a very first line of script. Before any html output. Regards, Veniamin SS> Hi there, SS> I'm currently working on a user login script. I'm using session SS> variables. Everything seems to be working fine but I continually get the SS> following warning message when I run the programs: SS> Warning: Cannot send session cache limiter - headers already sent SS> (output started at c:\phpdev\www\staffdb2\side_menu.php:3) in SS> c:\phpdev\www\staffdb2\side_menu.php on line 4 SS> The side_menu.php routine is below: SS> <LINK REL=STYLESHEET HREF="styles.css" TYPE="text/css"> SS> <BODY class="sidebar"> SS> <?PHP SS> session_start(); SS> //require_once('user_auth_fns.php'); SS> //check_valid_user(); SS> if (isset($HTTP_SESSION_VARS['valid_user'])) SS> { SS> echo '<a href="logout.php">Log out</a>'; SS> } SS> else SS> { SS> echo 'You are not logged in'; SS> } ?>> SS> The session variable 'valid_user' is set in the following routine: SS> <?PHP SS> require_once('staffdb_fns.php'); SS> session_start(); SS> $username=$HTTP_POST_VARS['username']; SS> $passwrd=$HTTP_POST_VARS['passwrd']; SS> if ($username && $passwrd) SS> { SS> if (login($username,$passwrd)) SS> { SS> $HTTP_SESSION_VARS['valid_user']=$username; SS> display_page_layout(); SS> } SS> else SS> { SS> echo 'login failed'; SS> display_login_form(); SS> exit; SS> } SS> } SS> else SS> { SS> display_login_form(); SS> } SS> //check_valid_user(); ?>> SS> Any ideas. SS> PS : I am rather new to php so be kind please. SS> Regards, SS> Steve. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php