Hi, I need code that reads from the roles database and then selects which file from these 3 which I want. For example, the user.php file would be loaded if the user has UName = user, Pass = 124, and Roles = User added to the database. But the admin.php and boss.php files would not appear to him.
Then only the user who would have it like UName = admin Pass = 125 and Roles = Admin would see the admin.php file, but he would not see the user.php and boss.php files. And of course the boss.php file would be seen by a user with UName = boss, Pass = 126 and Roles = Boss.
Please use only PDO!
I need to write this in this code somehow.
<?php
session_start();
if(!(isset($_SESSION['User'])))
{
header("Location: index.php");
exit(0);
}
?>
<!DOCTYPE html>
<html>
<body>
<?php
include "config.php";
?>
<!--show for User-->
<?php include 'user.php';?>
<!--show for Admin-->
<?php include 'admin.php';?>
<!--show for Boss-->
<?php include 'boss.php';?>
</body>
</html>