Weird Session + Include Problem
Posted: Wed Jul 23, 2003 9:31 am
G'day guys!
I'm trying to get user login on my current project working
Now, my main page has a php include() on it that puts either a login form, or a logout button on the page after it checks isset($_POST['username']);
Problem is this, when you login, the login script redirects you to the main page again, which SHOULD have a logout button there. Instead it just displays the login form.
Here's the weird part: if I get rid of that include() and paste the code that decides whether to display login/logout, straight into my main page everything works fine.
I use session_start() at the top of the main page, and the top of the login script. I've tried both with and without session_start() at the top of the included file and there's no difference.
I'm running PHP4.3.2 on Apache 2.0.45. Any help would be appreciated. I can't use Apache includes because the php doesn't get executed - help! eek!
Cheers,
Clinton Greer
cggreer@it.uts.edu.au
I'm trying to get user login on my current project working
Now, my main page has a php include() on it that puts either a login form, or a logout button on the page after it checks isset($_POST['username']);
Problem is this, when you login, the login script redirects you to the main page again, which SHOULD have a logout button there. Instead it just displays the login form.
Here's the weird part: if I get rid of that include() and paste the code that decides whether to display login/logout, straight into my main page everything works fine.
I use session_start() at the top of the main page, and the top of the login script. I've tried both with and without session_start() at the top of the included file and there's no difference.
I'm running PHP4.3.2 on Apache 2.0.45. Any help would be appreciated. I can't use Apache includes because the php doesn't get executed - help! eek!
Cheers,
Clinton Greer
cggreer@it.uts.edu.au