Page 1 of 1

PHP Login

Posted: Fri Nov 26, 2010 2:50 pm
by jhame
Hi guys,

I just want o ask some help, how to make a login with 3 user levels? thnks guys... :)

Re: PHP Login

Posted: Tue Dec 07, 2010 12:18 am
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.