i’m just about to pull my hair out over this one. here’s the basic flow of my login.php page right now
[code]
require(header.php)//contains the login function and the beginning of the html
if(login(user, pass)){
header(“Location: somewhere.php”);
}
require(footer.php)//contains the end of the html
problem, obviously, is that i can’t go somewhere else after html has started, right? so i would put all the php stuff above the header include, but then i wouldn’t be able to get at the login function. though, strangely, php does seem to be able to call functions that are extablished later in the script sometimes, but is this a safe thing to do? will it work in most versions of php?
is there another way to change the page without the visitor having to click anything, but that can be done from the middle of the page? last resort option is, of course, to split up the header into 2 files, but i would rather not do that. can i depend on the logout function working if i call it before it’s defined?