We are independent & ad-supported. We may earn a commission for purchases made through our links.
Advertiser Disclosure
Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.
How We Make Money
We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently of our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.
Software

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

What is the Common Gateway Interface?

Mary Elizabeth
By
Updated: May 16, 2024
Views: 8,934
Share

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.

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.

Share
EasyTechJunkie is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.
Mary Elizabeth
By Mary Elizabeth
Passionate about reading, writing, and research, Mary Elizabeth is dedicated to correcting misinformation on the Internet. In addition to writing articles on art, literature, and music for EasyTechJunkie, Mary works as a teacher, composer, and author who has written books, study guides, and teaching materials. Mary has also created music composition content for Sibelius Software. She earned her B.A. from University of Chicago's writing program and an M.A. from the University of Vermont.
Discussion Comments
Mary Elizabeth
Mary Elizabeth
Passionate about reading, writing, and research, Mary Elizabeth is dedicated to correcting misinformation on the...
Learn more
Share
https://www.easytechjunkie.com/what-is-the-common-gateway-interface.htm
Copy this link
EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.

EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.