What Is a CGI Program?

A CGI program is executed by the Web server in response to a request made by the Web browser. The Web server acts as an intermediary between the browser and the CGI program: it passes the browser’s request to the CGI program, and it sends output from the program back to the Web browser for processing. For example, a program might accept a stock ticker symbol, look up the stock price associated with that symbol and return it to the user as part of a dynamically generated Web page. Or, a program might accept a user’s comment, and send it to the site’s Webmaster in an email message. Almost any programming language can be used to write a CGI program; CGI itself is the defined interface between the Web server and the external ...

Get Sams Teach Yourself CGI in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.