1. Technology
Send to a Friend via Email

Using Forms and CGI

By

2 of 6

The HTML Form

A form has three required elements:

  1. <form> </form>
    The element that creates the form. This element has two important attributes, method and action. The method is either post or get. These are described in the article Method Attribute of the Form Tag. The action is a URL pointing to the CGI script that will run on the form data.
  2. <input />
    The element that generates the data for the form. For this simple form, we will use the input type of text.
  3. <input type="submit" />
    This is actually a sophisticated form of the <input /> tag, but in order for a form to be sent to the CGI, you must have this element.

©2014 About.com. All rights reserved.