This is a discussion on Problem handling SQL within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I am also a newbie. My goal is to check if a entered username and password match those in a ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I am also a newbie. My goal is to check if a entered username and password
match those in a MySQL db (it's a lot of different users). On each row in the db every user has an access-level (totally two different levels). How to check whether a entered username and password fits those in the db (in the actual row) and if they match, how to redirect them to the specific user level? I'm thinking of something like (IF (entered) customer_id = true AND (entered) customer_name = true, THEN redirect to the granted access_level. db-name: userbase table:users field:customer_id (user name) field:customer_name (password) field: access_level (value "10" or "20" - associated with one of two different urls) Any help would be highly appreciated. |
|
|||
|
Hi John,
i think this tutorial can help you very much. http://www.free2code.net/plugins/art...read.php?id=99 |
|
|||
|
the tutorial is fine...but I don't like the solution for the encrypted
password (personally I use MD5 encryption directly in MySql)...and it doesn't answer the problem of the acces_level. I now it's kind of simple after you have the login procedure written down to ad this feature. Anyway as the tutorial explains you can do a check_login.php file to include in the top of each page and maybe whats best for you is a function that checks the login and returns the acces_level. Once you have the access_level you can handle what to show the user or not. It's not so difficult you just need to try out some solutions. On the internet there are many tutorials about login procedure! |
![]() |
| Thread Tools | |
| Display Modes | |
|
|