Forum Moderators: open
// Register the values & redirect:
$_SESSION = mysqli_fetch_array ($r, MYSQLI_ASSOC);
mysqli_free_result($r);
mysqli_close($dbc);
$url = BASE_URL . 'login/memberarea.php'; // Define the URL:
ob_end_clean(); // Delete the buffer.
header("Location: $url");
exit(); // Quit the script.
As you can see its will direct all users to the page memberarea.php
Can anyone help?
The
$url = BASE_URL . 'login/memberarea.php'; // Define the URL:
Like membersarea.php?level=admin shows all admin features which the php file determines, membersarea.php?level=guest shows all guest features, etc.
Your membersarea.php would need to include a variable to capture the 'level' variable, then use a case statement or if statements to determine if X needs to be shown.
You could also create a seperate page for each level, category, etc and just put an if statement before the $url declaration and pass whatever is determined to be the right page:
$level = $_GET['level'];
switch ($level) {
case "admin";
$url = BASE_URL . 'login/memberarea_admin.php'; // Define the URL:
break;
case "guest";
$url = BASE_URL . 'login/memberarea_guest.php'; // Define the URL:
break;
}
either of these ideas would work, but without any more explaination, its hard to tell exactly what would be best.