Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

ARCHIVED: What is CGI?

The Common Gateway Interface (CGI) is a method of allowing a hyperlink to refer to a program rather than a static web page. The easiest way to understand how a CGI works is by contrast with an ordinary web page.

How does CGI work?

When you use a browser to link to a URL, the browser requests that the host named in the URL send the data specified by the rest of the URL. This is normally just the contents of the file or directory specified by the URL, encoded with the appropriate MIME type.

However, if the URL points to a CGI, the computer on the far end runs the program, and sends its output to the client as though the output were the contents of an HTML file. Depending on the URL, you might not be able to tell that a CGI ever ran.

CGIs are often used for processing submissions from HTML forms (collections of fill-in fields, checkboxes, buttons, etc.). They can also generate variable or customized content for a web page, ranging from visitor counters to data based upon information supplied by the client browser.

How can I write a CGI program?

You can write a CGI program in any programming language supported on the server computer. You can find many tutorials on the web to help you write a CGI. The following two are a good start:

http://www.lies.com/begperl/ http://wdvl.com/Authoring/CGI/

In addition, a number of excellent packages have been written that make it easier to program CGIs in Perl or C. To browse a huge collection of resources about CGI, HTML, forms, and all aspects of the web and the Internet, visit the University of Geneva's TECFA Toolbox page at:

http://tecfa.unige.ch/guides/toolbox.html

Note: CGI (computer-generated imagery) also refers to special effects graphics (in film, television, etc.) created with a computer.

This is document bacg in domain all.
Last modified on October 30, 2008.

Comments/Questions/Corrections

Use this form to offer suggestions, corrections, and additions to the Knowledge Base. We welcome your input!

If you are affiliated with Indiana University and would like assistance with a specific computing problem, please use the Ask a Consultant form, or contact your campus Support Center.

Contact Information

Note: We will reply to your comment at this address. If your message concerns a problem receiving email, please enter an alternate email address.