This question already has an answer here:
- The 3 different equals 5 answers
- Reference - What does this error mean in PHP? 34 answers
I made a login page, which works fine. Every account on my system has a username, password and permission. On the login screen you only have to fill in your username and password, and the record gets automatically linked to the session, so Im sure the session knows what permission it has when logged in. I want to make a difference between a admin and a user account. An admin account should be redirected to a different screen as the user. This is my code:
if ($_SESSION['Permission'] = "admin") {
header("location:adminmenu.html");
} else {
header("location:usermenu.html");
}
When I run this, it automatically takes me to the admin menu, even if the statement is not correct. How can I fix this?
This isnt the same, because the question isnt about parse errors.
</div>