HTTP headers and include()

From: Date: Fri, 10 Jul 2009 05:21:32 +0000
Subject: HTTP headers and include()
Groups: php.general 
Request: Send a blank email to php-general+get-295125@lists.php.net to get a copy of this message
Hey everyone, I've been hard at work on a new web application, and discovered something that I would never have seen coming. I was noticing that when I called session_start() after a few lines of includes, I was getting complaints because the HTTP headers had already been sent out. Then, after putting session_start() above the include lines, suddenly everything was working fine. The files that were included were nothing more than functions; there was no code executing that I could tell up to the point of the call to session_start(). I was just wondering if anybody on the list knows why HTTP headers were being sent out by my includes. I'm sure there's a good reason. I'm just very curious :) Thanks very much in advance. James

« previous php.general (#295125) next »