Hi,
I was reading Jason's session for newbies article on this site and did the example he gave and found out that there was an error,
After I loaded sessiontest.php, I got this error message:
Warning: Cannot send session cache limiter - headers already sent (output started at c:\program files\apache group\apache\htdocs\learn\sessiontest.php:1) in c:\program files\apache group\apache\htdocs\learn\sessiontest.php on line 3
Current Session Number Count: $num[count]
Here is my question, I have seen quite a bit of this happen when installing other scripts. Can someone explain to me why it's given this error message?
Thank you
Sessions for newbies example
Moderator: General Moderators
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
you cant output headers if something else is already being set, for instance a bit of html is printed, you can't do that
for instance:
would not work -- there is a extra line break at the top, this counts as outputting something
would not work -- stuff is being outputted
ditto, you get the point
for instance:
Code: Select all
<?php
header("Location: somewhere");
?>Code: Select all
<html>
<?php
header("Location: somewhere");
?>Code: Select all
<?php
echo "something";
header("Location: somewhere");
?>