Bug #2937: session_start() fails when used after require() or include()
| From: | marvin at minotaur dot com | Date: | Wed, 08 Dec 1999 19:06:10 +0000 |
| Subject: | Bug #2937: session_start() fails when used after require() or include() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-13511@lists.php.net to get a copy of this message | ||
From: marvin@minotaur.com
Operating system: linux
PHP version: 3.0.12
PHP Bug Type: Session related
Bug description: session_start() fails when used after require() or include()
I am using PHP 4.0 beta 2
Basically if I do
<?
session_start();
require 'htmlstuff.php'
blah blah blah
?>
the code works...
but if I do
<?
require 'htmlstuff.php'
session_start();
blah blah blah
?>
I get an error reading like:
Warning: Cannot add header information - headers already sent in /home/marvin/sla/index.php on line
5
If I use include instead of require, same error message. This also means I can not use
session_start inside of a function in a header file.
Contact me for clarifications/more info.
Marvin