Jump to content

(PHP Chapter : Login) "error"


Vilius

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...