php header() problem
Posted by: jstrauss
Posted on: 2005-01-06 12:07:00
Hi. I'm developing a site in PHP/mySQL and have come across something that i cannot figure out. On a different site (running as cgi) I have some simple authentication that works as expected. I copied the files to the new site (not running as cgi) thinking that they would just plug in and work.
I'm getting these warnings on my web page:
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/.x/x/x.com/admin/display.php:1) in /home/.x/x/x.com/admin/session_validate.php on line 7
Warning: Cannot modify header information - headers already sent by (output started at /home/.x/x/x.com/admin/display.php:1) in /home/.x/x/x.com/admin/session_validate.php on line 32
Line 1 of display.php is :
<? require($_SERVER['DOCUMENT_ROOT']."/admin/session_validate.php"); /* checks for valid session */ ?>
There is absolutely nothing before the <?.
I also deleted everything in the file except for line one and get the same result.
Line 32 is a redirect for incorrect login. header("Location: http://www....".
There is no output to the page, to empty lines, etc.
There is a login page with UN and PW fields. The action of the form is display.php which calls session_validate.php on line one.
As I said, this exact code works on the other site. The reason I mentioned the running as cgi is that I had a problem with a 404 error page. Could this be related?
Am I missing something?
John