these are the two files in which error is occurred:
html_form.html
<html>
<body>
<center>
<h1>Admission Form</h1>
<br>
<form action="php_register.php" name="registration">
Firstname: <input type="text" name="name1" placeholder="Enter Firstname"/>
<br>
Lastname: <input type="text" name="name2" placeholder="Enter Lastname"/><br>
<input type="submit" value="submit">
</form>
</center>
</body>
</html>
php_register.php
<?php
$fname=$_POST['name1'];
$lname=$_POST['name2'];
$conn=mysqli_connect("localhost","root","","test");
if (isset($fname) && isset($lname))
{
mysqli_query($conn, "insert into test_table(firstname,lastname)
values ('$fname','$lname')");
}
else
echo "<br> Errror....Values are not set in variables...!!!";
?>
( ! ) Notice: Undefined index: name1 in C:\wamp2\www\PHP_project\php_register.php on line 2 Call Stack
Time Memory Function Location
1 0.0022 131712 {main}( ) ...\php_register.php:0
( ! ) Notice: Undefined index: name2 in C:\wamp2\www\PHP_project\php_register.php on line 3 Call Stack
Time Memory Function Location
1 0.0022 131712 {main}( ) ...\php_register.php:0
Errror....Values are not set in variables...!!!