Detetc user_type login help

Hi nice people out there…

Okay currently I’m working on my log system for my office use…so my purpose is just wanna seek advise/guide from php guru’s here…the best/proper way to code this…Okay my problem is here…how to differentiate user level after the user success logging into the system…because what I’m working is now…I have 3 different page depends on user type after successing login…let’s say I have this type of record in my dtbase…

id | username | password | user_type |


0 | user1 | pwd | director |
1 | user2 | pwd2 | sa |
2 | user3 | pwd3 | programmer|

so the scenario is if the director login it’ll redirect to “directorindex.php” page
-and if sa succesing login into system it’ll redirect to “saindex.php” page and so on…

so I really need help on how to detect user_type after the login process because I want to redirect to the correct page…hope will get some shed on light on it…

thanks in advanced