Category: 

What is the Common Gateway Interface?

Article Details
  • Written By: Mary Elizabeth
  • Edited By: Bronwyn Harris
  • Last Modified Date: 26 November 2016
  • Copyright Protected:
    2003-2016
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
The Argentinian resort town of Epecuén was submerged by flooding for years; it is now populated by one elderly man.  more...

December 5 ,  1933 :  Prohibition ended in the US.  more...

In the realm of computers, a gateway can be several things, including a node that physically connects disparate networks, converting their protocols so they can communicate, or a functional service that provides an intermediary between multiple systems. Gateway programs can act as gateways between server-side resources — like databases — and the web. The Common Gateway Interface (CGI) was the initial mechanism that served as a generic interface between the server and these server-side gateway programs, and was used by most servers to process client requests that required server-side data processing. It is a standard, as well as an interface.

The Common Gateway Interface works in two directions. Suppose that a user sends a request through a web browser, such as submitting an HTML form with data in order to be added to a mailing list. The HTTP server can only serve documents, not process the data. So once the HTTP (HyperText Transfer Protocol) of data to the server is complete, the Common Gateway Interface conveys the data from the server to the gateway program that connects to the database. The results of the processing, such as a confirmation message, are returned to the user traveling on the path in reverse: from the database to the gateway program through the Common Gateway Interface to the server, through HTTP to the user’s web browser.

Ad

A Common Gateway Interface script is the name of the software program that was used to process a query to a database. It had the benefit of being operating system agnostic, meaning it would work on a server no matter which operating system it was running. While CGI was much used in the early days of the web, there are now newer, more efficient server-side methods for processing queries, and these are now found as well. These include ASP (Active Server Page) and its newer version ASP.NET (Active Server Page for dot-net, also known as ASP+) and JSP® (JavaServer Page), which allows the combination of HTML (HyperText Markup Language) and Java to work smoothly together on a single web page, but note that ASP is made by Microsoft® and only runs on Microsoft® web servers.

CGI itself has also developed. FastCGI™, an open standard, language-independent extension of CGI that allows for distributed computing, and — unlike CGI — does not exit after each request is complete, but persists, waiting for the next request. SCGI (Simple CGI) is another alternative, both a protocol and a program, placed in the public domain by its creator.

Ad

You might also Like

Recommended

Discuss this Article

Post your comments

Post Anonymously

Login

username
password
forgot password?

Register

username
password
confirm
email