I have a PHP task which I made a login page without a database and I have a button in the project file index.php i want to be unavailable for a normal user and available to an admin user.
how can I check or differentiate between user types in this case??
I made a login page which I save the username and password in an array like "john" => "123"
2
Answers
Even without a database, the way you store the data matters. Taking the idea of a
users
table, your array should look like a table with rows. Each row is a user. And the columns are id, name, password, email, userType, etc…If the array you used to store login details can be accessed globally, you can check the user type this way