Okay,
This is access.php:
<?php
// Include here your Database
session_start();
$sql = $mysqli->query("SELECT user_level FROM imobiliare_users WHERE id=$id");
$user_level = $mysqli->query($sql);
echo $user_level;
if ($user_level =="editor") {$user_wert = "1";}
if ($user_level =="admin") {$user_wert = "2";}
?>
You take in the .php Files:
<?php
include 'access.php';
// only Admin:
if($user_wert == "2") // This is the Query for the Admin
{ echo "This Looks only the Admin"; exit; } else { die("No Admin"); }
// only Editor:
if($user_wert == "1") // This is the Query for the Editor
{ echo "This Looks only the Editors"; exit; } else { die("No Editor"); }
// If you want a Page for Admin and Editor say:
if($user_wert >= "1") // This is the Query for the Editor and Admins ( All Ranks over the Number "1")
{ echo "This Looks only the Editors or Admins"; exit; } else { die("You a normal User."); }
?>
I use for If Query's only numbers.
You can say, the "normal" User is number 0.