andypalmer86
New Member
- Messages
- 4
- Reaction score
- 0
- Points
- 0
I have a session based login system on my site which worked fine on another server but I'm getting these errors on this server:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/andy86/public_html/index.php:1) in /home/andy86/public_html/index.php on line 2
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/andy86/public_html/index.php:1) in /home/andy86/public_html/index.php on line 2
I've searched the forums for similar problems but everyone i've seen has been because the person had output before the session_start() command...however my index.php file is like this:
Does anybody know what could be causing these errors? I'm guessing it could be the .htaccess file because I don't have any experience with that so I don't really know what it does :dunno:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/andy86/public_html/index.php:1) in /home/andy86/public_html/index.php on line 2
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/andy86/public_html/index.php:1) in /home/andy86/public_html/index.php on line 2
I've searched the forums for similar problems but everyone i've seen has been because the person had output before the session_start() command...however my index.php file is like this:
HTML:
<?php
session_start();
if (isset($_POST['logout']))
{
$_SESSION = array();
if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time()-42000, '/');
}
session_destroy();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="EN">
....