-
-
Save Pavaniysk/4f1b0786e8c7e43331416f17fafd975d 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"> | |
<input type="submit"> | |
</form> | |
<?php | |
if ($_SERVER["REQUEST_METHOD"] == "POST") { | |
// collect value of input field | |
$name = $_POST['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