how to authenticate a specific group of users using php/mysql?

  • Thread starter Thread starter betty
  • Start date Start date
B

betty

Guest
Hi guys, in the process of building a log in facility for a website whcih at the moment has username/password verification.
However, I have 3 groups of users with acess to different pages of the site and i'm not too sure how to go about it?
In my user_login table I have username, password and permission (this is either teacher, pupil, or parent), I was wondering how I could
1st - check username and password combo are correct
2nd - then check for example that the user visiting the teacher area is actually a teacher.

I've read hundreds of tutorials, none which have the same as what I was wanting.

It crossed my mind to add another input field into the login screen for users to type parent/teacher/pupil but don't think this is necessary, Im sure there is a much simpler way!

I did try out a method (a pretty bum 1) which basically said for e.g if username == 'joe' and password == 'bloggs' then permission == yes

therefore if permission == yes, they have access to this part of the site! But I really don;t want to have to do it that way, as there are potentially a lot of users and this way really wouldn't be logical, so PLEASE help!
 
Back
Top