Chapter 12. CGI Overview
The Common Gateway
Interface (CGI) is an essential tool for creating and managing
comprehensive web sites. With CGI, you can write scripts that create
interactive, user-driven applications.
CGI allows the web server to communicate with other programs that are
running on the server. For example, with CGI, the web server can
invoke an external program, while passing user-specific data to the
program (such as what host the user is connecting from, or input the
user has supplied through an HTML form). The program then processes
that data, and the server passes the program's
response back to the web browser.
Rather than limiting the Web to documents written ahead of time, CGI
enables web pages to be created on the fly, based upon the input of
users. You can use CGI scripts to create a wide range of
applications, from surveys to search tools, from Internet service
gateways to quizzes and games. You can count the number of users who
access a document or let them sign an electronic guestbook. You can
provide users with all types of information, collect their comments,
and respond.
This section provides a reference for the essential components of
CGI. For a comprehensive treatment of CGI programming we recommend
O'Reilly's CGI
Programming with Perl by Scott Guelich, Shishir Gundavaram
and Gunther Birznieks.
This chapter through Chapter 15 cover the following
CGI topics:
This chapter gives a quick introduction to the mechanism of CGI and
lists the environment variables commonly defined by servers for CGI
programs.
Chapter 13 covers Server Side Includes, used with
many CGI applications.
Chapter 14 is a reference for the popular Perl
module CGI.pm. CGI.pm defines one of the most widely used interfaces
for creating CGI programs.
Chapter 15 describes mod_perl,
which embeds Perl into the Apache web server.
mod_perl can greatly enhance the performance of
CGI and also provides an interface to the Apache API for Perl
programmers.
In addition, CGI programmers will probably also be interested in
Chapter 6, and Chapter 17.
 |