session problems
Posted: Mon Apr 28, 2003 7:10 am
Firstly i'm new to php and so this will no doubt be an easy answer to most of you
I am trying to implement a login script, the script works fine at the moment but when i tried to use the script included into my index page i kept getting session cache errors. I then added the site code into the script itself and the form works. the problem i have now is i want to have the "you are logged in as " link on all pages and when i tried adding :
<?
session_start();
echo "members";
if (session_is_registered("valid_user")) {
echo "you are logged in as $valid_user";
}
else {
echo "you are not logged in";
}
?>
to my index page i got this error:
Warning: Cannot send session cache limiter - headers already sent (output started at /home/httpd/vhosts/irealms.co.uk/httpdocs/crimson/index.php:27) in /home/httpd/vhosts/irealms.co.uk/httpdocs/crimson/index.php on line 46
membersyou are logged in as test
any idea why i am getting this error?
the site in question is http://www.irealms.co.uk/crimson
as you can see the link are in the form index.php?page=page name
I had to make a standard link for the login page as i was getting the above error when trying to include it in my index page.
Any help is greatly appreciated
I am trying to implement a login script, the script works fine at the moment but when i tried to use the script included into my index page i kept getting session cache errors. I then added the site code into the script itself and the form works. the problem i have now is i want to have the "you are logged in as " link on all pages and when i tried adding :
<?
session_start();
echo "members";
if (session_is_registered("valid_user")) {
echo "you are logged in as $valid_user";
}
else {
echo "you are not logged in";
}
?>
to my index page i got this error:
Warning: Cannot send session cache limiter - headers already sent (output started at /home/httpd/vhosts/irealms.co.uk/httpdocs/crimson/index.php:27) in /home/httpd/vhosts/irealms.co.uk/httpdocs/crimson/index.php on line 46
membersyou are logged in as test
any idea why i am getting this error?
the site in question is http://www.irealms.co.uk/crimson
as you can see the link are in the form index.php?page=page name
I had to make a standard link for the login page as i was getting the above error when trying to include it in my index page.
Any help is greatly appreciated