showing undefined index
why is my code showing "Notice: Undefined index: name in F:\xampp\htdocs\aaa\cart\eg.php on line 15" here is the code <!DOCTYPE html> <html> <head> <title></title> </head> <body> <form action="eg.php" method="post"> Name:<input type="text" name="name"><br><br> Age:<input type="text" name="age"><br><br> <input type="submit" name="submit" value="submit"> </form> <?php echo $_POST['name']; ?> </html>