Re: session_start() and header
| From: | Kelly Barrett | Date: | Wed, 21 Jun 2000 06:43:22 +0000 |
| Subject: | Re: session_start() and header | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-2446@lists.php.net to get a copy of this message | ||
I would think because session_start() is trying to output cookie header
information yet you have already output something.
You must call session_start() before anything has been output (blank lines,
spaces, anything)
e.g:
(blank line)
<?php
session_start();
?>
I think would not work. You must have something like:
<?php
session_start();
?>
or any other php code you have there, as long as it doesn't "print" or
"echo" anything before the session_start() call.
I hope that helps.
----- Original Message -----
From: sarahana <sarahana@cyberjunkie.com>
To: <php-general@lists.php.net>
Sent: Wednesday, June 21, 2000 5:25 PM
Subject: [PHP-GENERAL] session_start() and header
> Hi,
> I was just wondering: How come when I use session_start(); the error is
>
> Warning: Cannot add header information - headers already sent in
> C:\HTTPD\HTDOCS\admin.php
>
> ?
>
> thanks,
> sarahana
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>