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

GNU cgicc - A C++ class library for writing CGI applications
Copyright © 1996 - 2004 Stephen F. Booth
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.
Documentation generated Fri Jul 3 2015 00:51:38 for cgicc by doxygen 1.8.8