What could be causing the code to be executed even when the user rights are equal to 1?
The issue could be due to a logical error in the condition check for user rights. To solve this, ensure that the comparison operator used in the condition check is correct and that the user rights are being correctly retrieved and compared.
// Check if user rights are equal to 1 before executing the code
if ($user_rights == 1) {
// Code to be executed if user rights are equal to 1
// Add your code here
} else {
// Code to handle the case when user rights are not equal to 1
// Add error handling or redirect to a different page
}