28.2. Sample Data

This section details the sample data used in this chapter and in Chapter 31, "Using PHP." Note that the code listed in this section is available on the book's companion Web site, but it is also listed here for immediate reference.

28.2.1. Sample Form

The following form is used in the form examples — data from this form is sent to the form handler.

    <title>Sample Form</title>
    <form action="FORM_HANDLER" method="post">
    <table cellspacing="20">

      <!-- Text boxes -->
      First Name: <input type="text" name="fname" id="fname" size="20" /><br />
      Last Name: <input type="text" name="lname" id="lname" size="20" />

      <!-- Text area -->
      Address:<br />
        <textarea name="addr" id="addr" cols="20" rows="4"></textarea>

      <!-- Password -->
      Password: <input type="password" name="pwd" id="pwd" size="20" />

      <!-- Select list -->
      What product(s) are you<br />
interested in? <br /> <select name="prod" id="prod" multiple="multiple" size="4"> <option id="MB">Motherboards</option> <option id="CPU">Processors</option> <option id="Case">Cases</option> <option id="Power">Power Supplies</option> <option id="Mem">Memory</option> <option id="HD">Hard Drives</option> <option id="Periph">Peripherals</option> </select> </p> <!-- Check boxes --> <p> How should we contact you?<br /> <input type="checkbox" name="email" id="email" checked="checked" ...

Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.