CGI  Introduction

These notes are extracted from the site: CGI Made Really Easy  or, Writing CGI scripts to process Web forms.  You may wish to visit this site for additional information.

What is CGI or (Common Gateway Interface)?

CGI is not a language.  It's a simple protocol that can be used to communicate between Web forms and your program.

A CGI script can be written in any language that can read STDIN, write to STDOUT, and read environment variables, i.e. virtually any programming language, including C, Perl, or even shell scripting.

Structure of a CGI Script

Here's the typical sequence of steps for a CGI script:

1. Read the user's form input.
2. Do what you want with the data.
3. Write the HTML response to STDOUT.

A CGI script is a computer program that interprets the data sent to it by the visitor. It divides this long stream of hard to read  data into something you can more easily read and use.

Other Refererences on the WWW:

Last updated on 02/04/2009 by L.M. Hicks