0
votes

I'm starting with CodeIgniter, and I must admit not very advanced in php. I need to redirect users to different pages based on the roles given to them in the database. Only the username and password is submitted on the login page. I have to fetch the role from the database which looks like this:

[1]: http://i.stack.imgur.com/AyZcU.png

1

1 Answers

0
votes

Usual login process goes like this:

(1) Validate form

(2) If validation successful, check given login credentials against the database

(3) If credentials are correct, redirect

In your case, you need to extend point 3, so:

(3) If credentials are correct, check user type based on the credentials given, and redirect respectively. In other words, you need to work with if - elseif - else. This way spacific user will be redirected to specific page.