Forum Moderators: coopster
Unfortunately header() won't redirect if you already printed output. What way would you recommend to redirect a user to a different page without them actually clicking a button/link?
Basically the login page goes like this:
1. Get user email/pwd
2. Check to see if email is correctly formatted (if it isn't, then keep user at the login page)
3. After making sure email is accurate, submit email/pwd to database
4. If email matches an organization then redirect to an organization page
5. If email matches a member, redirect to the member page
Its part 4/5 that got me stumped...
--Nick
In psuedo code:
check1, db query to organisation table
check2, db query to member table
if found in organisation
direct to organisation page
else if found in member table
direct to member page
end if
All you'd have to do is decide what takes precedence, and what to do if it's not found in either table.
Just make sure the above checks happen before you send any headers to the page so you can call header('location: ') successfully. If I read you right you had one of them working, but not the second. You won't be able to call it twice...