Sample Form 2

This form includes a submit button.

Just type in your name (and click Submit) to enter the contest:
First name:
Last name:


HTML code that created the form above.

    <form action="http://www.headfirstlabs.com/contest.php" method="POST">
      <p>Just type in your name (and click Submit) to enter the contest:<br />

        First name: <input type="text" name="firstname" value="" /><br />
        Last name:  <input type="text" name="lastname" value="" /><br />
        <input type="submit" />
      </p>
    </form>
  

The important part of the PHP file (web app) used to process this form:

  <p>
Thanks, <strong><?php print($firstname); print(" "); print($lastname); ?></strong>,
for entering the Head First HTML with CSS & XHTML Chapter 14 contest.
</p>
<p>
If you win something, you'll be the first to know.
</p>