Sessions?
Posted: Tue Feb 28, 2006 11:52 am
The following code:
yields this error:
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /path/file.php:6) in /path/file.php on line 8
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /path/file.php:6) in /path/file.php on line 8
I discovered that NOTHING can go before the session_start(), so I changed the code to:
That resulted in this error:
Parse error: parse error in /path/file.php on line 5
What's wrong, and how do I fix it?
Thanks
Code: Select all
<html><head>
<title>Log In to Database</title>
</head>
<body bgcolor="#FFFFFF">
<?php
session_start();Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /path/file.php:6) in /path/file.php on line 8
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /path/file.php:6) in /path/file.php on line 8
I discovered that NOTHING can go before the session_start(), so I changed the code to:
Code: Select all
<?php
session_start();
<html><head>
<title>Log In to Database</title>
</head>
<body bgcolor="#FFFFFF">Parse error: parse error in /path/file.php on line 5
What's wrong, and how do I fix it?
Thanks