-1

I am trying to build a Login page ( simple ) every time I run the website I got this error code

Notice: Undefined index: name in C:\xampp\htdocs\project1\index.php on line 14

on the screen in the web that I made.

Here is my source code:

<!DOCTYPE html>
    <html>
    <head>
    <title>Login</title>
    </head>
    <body>


    <form action="Login.php" method="get">
Name: <input type="text" name="name">
  <input type="submit">
 </form>
 <br>
 <?php echo $_GET["name"] ?>

 </body>
  </html>

1 Answers1

2

You have not get parameter with name "name". Make check for that like"

....
</form>
<br>
<?php if(isset($_GET['name'])){
        echo  $_GET['name'];
    } ?>

Also for login better use POST method

vvpanchev
  • 547
  • 1
  • 6
  • 14