Introduction to CGI

The Common Gateway Interface (CGI) is a standard protocol for enabling applications (commonly called CGI programs or CGI scripts) to interact with Web servers and (indirectly) with clients (e.g., Web browsers). CGI is often used to generate dynamic Web content using client input, databases and other information services. A Web page is dynamic if its content is generated programmatically when the page is requested, unlike static Web content, which is not generated programmatically when the page is requested (i.e., the page already exists before the request is made). For example, we can use a static Web page to ask a user to input a ZIP code, then redirect the user to a CGI script that generates a dynamic Web page customized for people in that geographical area. In this chapter, we introduce the basics of CGI and use C++ to write our first CGI scripts.

The Common Gateway Interface is "common" in the sense that it is not specific to any particular operating system (such as Linux or Windows) or to any one programming language. CGI was designed to be used with virtually any programming language, such as C, C++, Perl, Python or Visual Basic.

CGI was developed in 1993 by NCSA (National Center for Supercomputing for use with its popular HTTPd Web server. Unlike Web protocols and languages that have formal specifications, the initial concise description of CGI written by NCSA proved simple enough that CGI was adopted as an unofficial standard worldwide. CGI support was incorporated quickly into other Web servers, including Apache.

C++ How to Program
C++ How to Program (5th Edition)
ISBN: 0131857576
EAN: 2147483647
Year: 2004
Pages: 627
Simiral book on Amazon © 2008-2017.
If you may any questions please contact us: