I'm using the following code to make a logout page.
<?php
session_start();
include("config.php");
include("header.php");
echo "<html><head><title>$websitename ::Logout</title><body>";
echo "</body></head></html>";
if ($_SESSION[loggedin] ==1)
{
session_destroy();
echo "You have been logged out.<br>";
echo "Please click <a href='login.php'>here</a> to return to the login page.<br>";
}
else
{
echo "You are not currently logged in and cannot perform this action.<br>";
echo "Please click <a href='login.php'>here</a> to return to the login page.<br>";
}
include("footer.php");
?>
now when I run that page, I get this error:
Warning: Cannot send session cache limiter - headers already sent (output started at c:\program files\apache group\apache\htdocs\header.php:33) in c:\program files\apache group\apache\htdocs\footer.php on line 2
I dont understand what I'm doing wrong, i did session_start before any other output was sent. Any ideas how not to get this error. Also, the actual code works, I just hate that error showing up.