redirect base on user level
I need to redirect users with user level "1" to my admin section & user level "2" to the members section.
I've tried this code from another post in my login success page (modified version in attachment) without success.
Is this solution still current?
<?php
if(!session_id()) session_start();
switch($_SESSION['UserLevel']) {
case "admin":
header("Location: admin_index.php");
break;
case "visitor":
header("Location: visitor_index.php");
break;
}
?>