Jump to content

Recommended Posts

Posted

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 53

Notice: Undefined index: badUserCredentials in C:\MAMP\htdocs\logIn.php on line 54

Posted (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 by Vilius
Correction

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...