An HTML Form That Calls Itself : Form Post « Form « PHP






An HTML Form That Calls Itself

 
<html>
<head>
<title>An HTML Form that Calls Itself</title>
</head>
<body>
<div>
<?php
if ( ! empty( $_POST['guess'] ) ) {
    print "last guess: ".$_POST['guess'];
}
?>
<form method="post" action="<?php print $_SERVER['PHP_SELF']?>">
<p>
Type your guess here: <input type="text" name="guess" />
</p>
</form>
</div>
</body>
</html>
  
  








Related examples in the same category

1.Combined Feedback Form
2.Form submitting
3.GET vs. POST
4.Making a multipage form
5.One-script form processing
6.Preventing Multiple Submissions on the Client Side
7.Preventing Multiple Submissions on the Server Side