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

An HTML Form That Calls Itself

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

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