Created
January 4, 2023 17:20
-
-
Save Pavaniysk/c089290f16de345c55672747bb1c2266 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>"> | |
Name: <input type="text" name="fname"> | |
<br> | |
<br> | |
father name:<input type="text" name="fname"> | |
<br> | |
<br> | |
mother name:<input type="text" name="fname"> | |
<br> | |
<br> | |
mobile number:<input type="number" name="user"> | |
<br> | |
<br> | |
<input type="submit"> | |
</form> | |
<?php | |
if ($_SERVER["REQUEST_METHOD"] == "POST") { | |
// collect value of input field | |
$name = htmlspecialchars($_REQUEST['fname']); | |
if (empty($name)) { | |
echo "Name is empty"; | |
} else { | |
echo $name; | |
} | |
} | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment