-HTML code-
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container text-justify">
<h1>Fill this form pliz</h1>
<div class="form-group">
<form name="myform" method="post" action="formdb.php">
First name:<br> <input type="text" name="fname" placeholder=" First-name" required>
<br>
Second name:<br><input type="text" name="fname" placeholder=" Second-name" required>
<br>
Age:<br><input type="number" name="age" min="15" max="100" placeholder=" Age">
<br>
Email:<br><input type="email" name="email" placeholder=" E-mail">
<br><br>
Gender:<br>
<input type="radio" name="gender" value="Male"> Male<br>
<input type="radio" name="gender" value="Female"> Female <br>
<input type="radio" name="gender" value="Other"> Other <br>
Password:<br><input type="password" name="password" placeholder=" Password">
<br><br>
<input type="submit">
</form>
</div>
</div>
</body>
</html>
-PHP code-
<?php
echo "Values recieved"."<br>";
$fname=$lname=$age=$email=$sex=$pass="";
function test_input($data){
$data=trim($data);
$data=stripslashes($data);
$data=htmlspecialchars($data);
return $data;
}
if($_SERVER["REQUEST_METHOD"]=="POST")
{
echo"bitch";
$fname=test_input($_POST['fname']);
$lname=test_input($_POST['lname']);
$age=test_input($_POST['age']);
$sex=test_input($_POST['gender']);
$email=test_input($_POST['email']);
$pass=test_input($_POST['password']);
}
echo "First name is ".$fname;
?>
When I submit the form, I get an error from Firefox saying that "This address wasn't understood". Both the PHP and HTML are located in the same directory. Is it an issue caused by Firefox or is there an error on my part?