Parts of CGI Programs

A CGI program can generally be broken down into three components. The program must process input, execute the code that gives the program its actual functionality, and generate output. The code that is sandwiched between the input and output can be thought of as the data processing functionality.

Take, for example, a program that sends form data to a particular email address. It must process the form data submitted by the browser, compose and send the email message, and then print an acknowledgement indicating that the email was sent. Or, let’s say you’re writing a program for your intranet that allows company employees to change their health coverage. Your program would read their form input, store their health coverage ...

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.