![]()
CGI
The Common Gateway Interface (CGI) is the standard specification for communicating between HTTP servers and server-side 'gateway' programs.A typical use of CGI is for a form document (mailto, query, et cetera) resource, either for gathering information from or passing information to the client. We'll give a glimpse of the extreme basics of CGI by showing a use of the HTML FORM element.
FORM Element
The FORM element allows you to create a "fill-out" form: the user reading the HTML document will see the FORM elements as features of the document for user input -- he or she can then type information into the fields or select from buttons and pull-down menus to input their data.When the user submits the FORM, the data is encoded and transmitted to the server to be interpreted and processed. In general, the processing of the FORM data is done by a CGI program or programs residing on the server.
An example (if rather idiotic) FORM is:
<FORM ACTION="http://www.ziplink.net/cgi-bin/cgiwrap/amarlin/sample.cgi" METHOD=POST> Enter your name: <INPUT NAME="entry1"><BR> Enter your nickname: <INPUT NAME="entry2"><BR> Enter anything else: <INPUT NAME="entry3" VALUE="anything else"><BR> Select your favorite amphibian or fruit from these: <SELECT NAME="entry4"> <OPTION> Frog <OPTION> Apple <OPTION> Newt <OPTION> Orange <OPTION> Salamander <OPTION> Grapes </SELECT> To submit the query, press: <INPUT TYPE="submit" VALUE="Submit Query"> </FORM>(note that you can use TABLEs to format the layout of a form). The above FORM is rendered as follows:
The user fills in the blanks or selects items from the list and presses "Submit Query". This form works, so enter some information and submit it to get a response from the sample CGI program.
For CGI scripts as well as further information on CGI, a good place to start is The CGI Resource Index at:
http://www.cgi-resources.com/.To learn how to use CGI on your personal ZipLink Website, see our page on Working with Cgiwrap.
Back to Frames Back to the Ziplink 101 page ©2000 ZipLink. All Rights Reserved.