Login System in PHP -


i've created working login system , i've used cookies. in database, have different types of users , different pages displayed when user logs in. how can that?

alert("invalid email or password, try again!");window.history.go(-1);'; } ?>

make field in database called 'usertype' when display page, if check against usertype , display correct page 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 actual pages, you'll want check, if user goes page, , arent type of user, redirected or wherever want.

so on page dashboard1.php instance you'll have.

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

Comments