[Solved] Login System in PHP [closed]


Make a field in your database called ‘usertype’
Then when you display the page, just do an if check against the usertype and display the correct page for each.

 if($user->usertype=='your_usertype1'){
    header('location: http://www.yoursite.com/dashboard1');
 } else if($user->usertype=='your_usertype2'){
    header('location: http://www.yoursite.com/dashboard2');
 } else {
    header('location: http://www.yoursite.com/dashboarddefault');
 }

Obviously though, on the actual pages, you’ll want to also do a check, so that if a user goes to that page, and they ARENT that type of user, they will get redirected back or to wherever you want.

So on page dashboard1.php for instance you’ll have.

 if($_SESSION['user']['usertype']!='your_usertype1'){
    header('location: http://www.yoursite.com/'); // direct back if the user isnt of this type
 }

solved Login System in PHP [closed]