Warning: Trying to access array offset on value of type bool in C:\xampp\htdocs\POS SYSTEM\2. User Module\controllers\users.controller.php on line 29 in PHP Coding Help Posted October 14, 2021 hello pls i have been facing this error for days now . can someone help me to fix it. the bold line is the one having the warning message. if($answer["username"] == $_POST["loginUser"] && $answer["password"] == $encryptpass) { $_SESSION["loggedIn"] = "ok"; $_SESSION["id"] = $answer["id"]; $_SESSION["name"] = $answer["name"]; $_SESSION["username"] = $answer["username"]; $_SESSION["picture"] = $answer["picture"]; $_SESSION["profile"] = $answer["profile"]; echo '<script> window.location = "home"; </script>'; } else { echo '<br><div class="alert alert-danger">User or password incorrect</div>'; }
Warning: Trying to access array offset on value of type bool in C:\xampp\htdocs\POS SYSTEM\2. User Module\controllers\users.controller.php on line 29
in PHP Coding Help
Posted
hello pls i have been facing this error for days now . can someone help me to fix it. the bold line is the one having the warning message.
if($answer["username"] == $_POST["loginUser"] && $answer["password"] == $encryptpass)
{
$_SESSION["loggedIn"] = "ok";
$_SESSION["id"] = $answer["id"];
$_SESSION["name"] = $answer["name"];
$_SESSION["username"] = $answer["username"];
$_SESSION["picture"] = $answer["picture"];
$_SESSION["profile"] = $answer["profile"];
echo '<script>
window.location = "home";
</script>';
}
else
{
echo '<br><div class="alert alert-danger">User or password incorrect</div>';
}