you easily have 2 times too much typing in that code, and burred somewhere in all that you have a mistake with an else statement. you need to start with the basics and keep it simple. your login system should only identify who the user is, with one session variable to hold the user_id (autoincrement primary index.) it is also not up to the user to specify their role when logging in. aside from a parent registering their children, the role should be determined completely by data stored only