I’ve used this tutorial as base to create a login script:
http://www.wikihow.com/Create-a-Secure-Login-Script-in-PHP-and-MySQL#
Everything works just fine. Users can login, logout, etc. Now I’ve tried to add a function but can’t get this function to work.
In the table that stores the data (username, password, etc) after registration I’ve added an extra field “isAdmin”. This stores a simple “yes” or “no” value, to tell if the user that tries to login gets full administrator rights or not. On the registration page I’m able to submit this value, so after registration the value is succesfully stored. But after registration, in the login section, somehow this value isn’t returned the right way.
Basically, what I’m trying to achieve:
if (user_that_logs_in.isAdmin == “yes”) -> go to administrator_page.php
if (user_that_logs_in.isAdmin == “no”) -> go to regular_page.php
what do I need to adjust/add to get this function to work?