. . . . . . . . Talk 4, Page 10

CGI

The program that handles the data from a form is a CGI (Common Gateway Interface) script. It resides on the server. It can be written in any language, most often C or Perl, a scripting language. Each of the input fields in a form has a variable name and the script can determine the value of each variable. In the example used in the last page the name of the (only) variable is "zip."

The script receives the data in the form

variable1=value1&variable2=value2&variable3=value3

and so on for as many variables as are used. The script splits the variable-value pairs apart, does whatever calculations it wants using the values, and returns to the browser a new page. It may also do other things such as initiate e-mail.

The next slide shows a Perl script that handles the form with the zip code field.

Writing CGI scripts is beyond the scope of this ProForum, but writing an HTML form is not.


Start of event . . Schedule . . Previous talk . . Start of talk . . Back . . Forward . . Next talk

Click here for information on MIT Accessibility