Definition

common gateway interface (CGI)

Also see FastCGI.

The common gateway interface (CGI) is a standard way for a Web server to pass a Web user's request to an application program and to receive data back to forward to the user. When the user requests a Web page (for example, by clicking on a highlighted word or entering a Web site address), the server sends back the requested page. However, when a user fills out a form on a Web page and sends it in, it usually needs to be processed by an application program. The Web server typically passes the form information to a small application program that processes the data and may send back a confirmation message. This method or convention for passing data back and forth between the server and the application is called the common gateway interface (CGI). It is part of the Web's Hypertext Transfer Protocol (HTTP).

If you are creating a Web site and want a CGI application to get control, you specify the name of the application in the uniform resource locator (URL) that you code in an HTML file. This URL can be specified as part of the FORMS tags if you are creating a form. For example, you might code:

<FORM METHOD=POST ACTION=http://www.mybiz.com/cgi-bin/formprog.pl>

and the server at "mybiz.com" would pass control to the CGI application called "formprog.pl" to record the entered data and return a confirmation message. (The ".pl" indicates a program written in PERL but other languages could have been used.)

The common gateway interface provides a consistent way for data to be passed from the user's request to the application program and back to the user. This means that the person who writes the application program can makes sure it gets used no matter which operating system the server uses (PC, Macintosh, UNIX, OS/390, or others). It's simply a basic way for information to be passed from the Web server about your request to the application program and back again.

Because the interface is consistent, a programmer can write a CGI application in a number of different languages. The most popular languages for CGI applications are: C, C++, Java, and PERL.

An alternative to a CGI application is Microsoft's Active Server Page (ASP), in which a script embedded in a Web page is executed at the server before the page is sent.

This was last updated in November 2005
Posted by: Margaret Rouse

Email Alerts

Register now to receive SearchSOA.com-related news, tips and more, delivered to your inbox.
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

More News and Tutorials

  • Q&A: Messaging middleware with Apache projects

    In this Q&A, Rob Davies discusses messaging middleware and the hurdles that many developers face as they first approach the subject. Davis is CTO of FuseSource and coauthor of the book "ActiveMQ in Action."

  • SOA, semantics and services combine in DoD intelligence sharing effort

    Using textual analytics and natural language processing, Modus Operandi developed a service that analyzes and parses unstructured data and pulls out events or information. Article includes tips on SOA and semantics, SOA and data models, and an SOA recipe for stone soup.Among highlights: Recognize that not everything can be or should be shared.

  • An SOA practices checklist for implementation roadmaps

    This article provides a master list of common practices, field proven by a number of SOA projects. Also supplied is a template that can be used as a checklist for developing SOA implementation roadmaps specific to an organization's transition project requirements.

Do you have something to add to this definition? Let us know.

Send your comments to techterms@whatis.com

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: