I have an empty php file with this code in it.
<?php
session_start();
if ($_SESSION['box'])
{
} else {
include('/home/maine/www/inc/box.inc');
$_SESSION['box'] = "value";
}
?>
and this page works perfectly. Its supposed to check for the session cookie and if its not set, show this file, but if it is set, dont show the file.
BUT,
when i insert this code on to the pages through website, they all show this error.
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/main/public_html/page.php: in /home/main/public_html/page.php on line 13
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/main/public_html/page.php.php: in /home/main/public_html/page.php on line 13
None of the other pages set a cookie. So, the code works when its by itself, (on its own blank filename.php page but when I put it on anyother.php file page, i get this error. Anyone know how to get around this?