1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
/* -*-html-*- */
/*
* $Id: cgi-overview.tmpl,v 1.6 2004/06/29 15:13:15 sbooth Exp $
*
* Copyright (C) 1996 - 2004 Stephen F. Booth <sbooth@gnu.org>
* Part of the GNU cgicc library, http://www.cgicc.org
*
* Permission is granted to copy, distribute and/or modify this document
* under the terms of the GNU Free Documentation License, Version 1.1
* or any later version published by the Free Software Foundation;
* with no Invariant Sections, with no Front-Cover Texts, and with
* no Back-Cover Texts.
* A copy of the license is included in the section entitled "GNU
* Free Documentation License".
*/
/*! \page cgi_overview Overview of the Common Gateway Interface
\htmlonly
<div class="header">What is the Common Gateway Interface?</div>
<div class="subsection">
\endhtmlonly
The Common Gateway Interface (CGI) is a standard for external gateway
programs to interface with information servers, such as HTTP
servers. The official specification for the Common Gateway
Interface may be found at http://hoohoo.ncsa.uiuc.edu/cgi/interface.html
\htmlonly
</div>
\endhtmlonly
\htmlonly
<div class="header">CGI scripts or CGI applications?</div>
<div class="subsection">
\endhtmlonly
Historically, many CGI applications were written in scripting languages
such as Perl. Not surprisingly, CGI code called by the HTTP server was
referred to as a CGI \e script. As the popularity of the web grew
and the need for dynamic content increased, CGI applications written in
languages other than Perl became more and more popular. These
applications were referred to simply as scripts. Although the term
script does not make intuitive sense for a compiled program, the
term has stuck. In this manual, the terms \e script and
\e application are used interchangeably.
\htmlonly
</div>
\endhtmlonly
\htmlonly
<div class="header">CGI Processing</div>
<div class="subsection">
\endhtmlonly
When an HTTP server receives a request for a CGI script, the
server communicates to the script the details of the request. The
HTTP server and a CGI script communicate in four major ways:
<ol>
<li><strong>Environment variables</strong>
The HTTP server uses environment variables to pass information
about the request to the CGI script. Depending on the type of
request, the environment variables may or may not contain all the
information required by the script to function properly.</li>
<li><strong>The command line</strong>
The command line is only used for \c isindex queries. Generally,
\c isindex queries should not be used; since the command line is used
directly, they present many potential security risks.</li>
<li><strong>Standard input</strong>
For HTTP \c POST or \c PUT queries, the HTTP server communicates
information to the CGI script via standard input. The amount of
information written to standard input is stored in the
\c CONTENT_LENGTH environment variable.</li>
<li><strong>Standard output</strong>
A script returns its output on standard output. The output can be a
document generated by the script, or instructions to the server for
retrieving the desired output.</li>
</ol>
\htmlonly
</div>
\endhtmlonly
\htmlonly
<div class="nav">
\endhtmlonly
Previous: \ref index |
Current: \ref cgi_overview |
Next: \ref lib_overview
\htmlonly
</div>
\endhtmlonly
*/
|