Help - Search - Members - Calendar
Full Version: Session checking causes headers to be sent
Weborum Webmaster Forum > Web Page Design > PHP
sjthomas
I've just been playing about with a few things and have come across a strange problem. I'm reusing my standard login and user verification code but its saying headers already sent when redirecting. The line that is supposedly causing the headers to be sent is this:
CODE
if (!($_SESSION['userName'] && $_SESSION['password'])){

Which strikes me as odd. It seems even stranger that the files are identical to the ones I always use and always work, the only difference is the paths to my includes and the database. Anyone got any ideas? At the moment I'm getting around it by using output buffering, which I don't really like using, I'd rather figure out what the problem is as opposed to just getting round it.
Joe
What header code do you have in your script Si, can you post it?
sjthomas
QUOTE(joe2kiss @ Mar 26 2006, 05:26 PM) [snapback]33683[/snapback]

What header code do you have in your script Si, can you post it?



Thats the thing Joe, there isn't any, thats practically the first bit of the file apart from instantiating the class (which also starts the session). There is nothing else, its bizarre. There is a header redirect (header(location: url)) later on but thats the one thats being prevented from working. There is nothing else, thats the line that triggers everything else off like the other session checks or processes the login information if theres no session, its weird as hell. And PHP is throwing a warning over that specific line.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.