Vilius Posted February 18, 2021 Report Share Posted February 18, 2021 I'm traveling through chapter LOGIN in PHP, and i'm getting this error. I copied everything from the source code so there are no spelling mistakes. Google saying this: " This error means that within your code, there is a variable or constant that has no value assigned to it. But you may be trying to use the values obtained through the user form in your PHP code." Please help! Notice: Undefined index: isBlock in C:\MAMP\htdocs\logIn.php on line 53Notice: Undefined index: badUserCredentials in C:\MAMP\htdocs\logIn.php on line 54 Quote Link to comment Share on other sites More sharing options...
administrator Posted February 18, 2021 Report Share Posted February 18, 2021 Hi use the isset()function. Check this out: Quote Link to comment Share on other sites More sharing options...
Vilius Posted February 18, 2021 Author Report Share Posted February 18, 2021 (edited) Here it is ! i don't get it, why am i seeing this error <?php // using the querystring to send messages back to this login page. $isBlock = $_GET["isBlock"]; line 53 --------------------- $badUserCredentials = $_GET["badUserCredentials"]; line 54-------------------- if(isset($isBlock)) { echo "<h2>Ah, ah, aaaaah ... you need to log in buddy!</h2>"; echo "<script>document.getElementById('username').focus();</script>"; } else if($badUserCredentials) { echo "<h2>User name OR password is wrong buddy!</h2>"; echo "<script>document.getElementById('username').focus();</script>"; } ?> Edited February 20, 2021 by Vilius Correction Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.