PHP Login

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jhame
Forum Newbie
Posts: 2
Joined: Fri Nov 26, 2010 2:39 pm

PHP Login

Post by jhame »

Hi guys,

I just want o ask some help, how to make a login with 3 user levels? thnks guys... :)
matt1234
Forum Commoner
Posts: 44
Joined: Wed Nov 26, 2008 9:43 pm

Re: PHP Login

Post by matt1234 »

Well, you need a way to set these user levels by specifying who is in these levels. I had a case where a new user would sign up and they would, by default, receive the lowest permissions, like a very basic user. Once I saw who it was, I could change their status in the database, giving them more rights.

Basically, you need a table which holds, at the minimum, cells for: A username, A password, A "permissions level"

Then during your login script, you can check "If the permissions level tied to this username is a 1, show them this information. Else if it is a 2, show them this information. Else if it is a 3, show them this information." That's a very basic answer but it all depends on what you're looking to have happen once the user logs in. So, long story short, you need to store this stuff into a database and check for which permissions level they are during your login script.
Post Reply