0

When i made a simple student registration page, i gave some input values to the fields and tried to exho those values simply by using POST. But it shows "Undefined Variable"

Below is my code for making a simple student registration form.

                            <head>

                                            <title>Student's Registration Form</title>

                            </head>

                            <body>
Student's Registration Form Student's Name: Father's Name: School's Name: Roll No: Class: Select Class 10th 9th
                            </body>

1 Answers1

0

Its undefined because you haven't declared the variable or accessing the array using the undefined index.

you need to access array element as

if (array_key_exists($key, $array)) {
  echo $array[$key];
}
Hari Lamichhane
  • 520
  • 5
  • 11