0

Hi all, ive been researching user management programs on codecanyon.net, and ive got a few programs in mind. the only issue i have is redirecting users of certain groups to a different parts of the website. is it a good idea to have them login and then have them redirect to a index page where their user group/level could then be used as a php CASE code to determine which part of the site they should go to? Thanks for your expertise!!

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by broj1
0

@duneflyingyfz_1

is it a good idea to have them login and then have them redirect to a index page where their user group/level could then be used as a php CASE code to determine which part of the site they should go to?

It's is weird question! OK, here is a link with a diagram:

http://www.phpf1.com/tutorial/php-switch-case.html

to me I don't feel it's going to work. But if you feel you like example of the diagram and you want that then do it.

Can you at least show or post a code that show the login that redirect the page?

0

In the database each user should have a group number (or you should have some other mechanism in place to distinguish groups). Then on the login page you redirect a user to the page for his group using using switch statement and header('location:mygroup.php').

switch($userGroup) {

    case 1:
        header('location:group1.php');
        break;

    case 2:
        header('location:group2.php');
        break;

    ....

    default:
        header('location:logout.php');
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.