Hide Copy Code
Hello! I want to create a page that is only accessible for Admin users, on my SQL tables I created a table called ‘users’ and created a column called ‘isAdmin’ and if the user is an admin, I entered a 1 instead of a 0. Additionally, in the table there is a ‘u_id’ which is used to show if a user is logged in or not. I would like to use both these tables to create a page that is only accessible if you’re logged in and an admin user.
Here is my code:
<?php
if (isset($_SESSION['u_id'] && ['isAdmin! = 1'])) {
} else {
header("Location: ../loginsystem/index.php");
}
?>
But it doesnt work, please can someone help.