Skip to main content
Participant
February 17, 2010
Answered

redirect user based on access level

  • February 17, 2010
  • 1 reply
  • 2480 views

Using the Log In User server behavior I am trying to redirect users to different pages based on their access level.  For example, users of access level X would be redirected to x.html while users of access level Y would be redirected to y.html and so on.  Any idea how I can adapt the code generated by the Log In User server behavior to give my login page this capability?  I'm using php/mysql.

Thanks,

Reiger

This topic has been closed for replies.
Correct answer David_Powers

With the Dreamweaver Log In User server behavior, you send users to a single page if they log in successfully. Set that page to accept users of both access levels.

Inside the page, use a conditional statement to redirect the users to their relevant pages. Access level is stored in a session variable called $_SESSION['MM_UserGroup'].

if ($_SESSION['MM_UserGroup'] == 'x') {

  header('Location: http://www.example.com/x.php');

  exit;

} elseif ($_SESSION['MM_UserGroup'] == 'y') {

  header('Location: http://www.example.com/y.php');

  exit;

}

1 reply

David_Powers
David_PowersCorrect answer
Inspiring
February 18, 2010

With the Dreamweaver Log In User server behavior, you send users to a single page if they log in successfully. Set that page to accept users of both access levels.

Inside the page, use a conditional statement to redirect the users to their relevant pages. Access level is stored in a session variable called $_SESSION['MM_UserGroup'].

if ($_SESSION['MM_UserGroup'] == 'x') {

  header('Location: http://www.example.com/x.php');

  exit;

} elseif ($_SESSION['MM_UserGroup'] == 'y') {

  header('Location: http://www.example.com/y.php');

  exit;

}