29.4. cgi and HTM script

When a browser makes a request to load a page, the Web server looks at the incoming URL. If there is cgi-bin as part of the URL path, the server opens a connection, which is usually a pipe to the requested cgi script. All input and output from the cgi script is sent through this pipe. Now, if the cgi script is to display a formatted Web page it must have HTML tags within the script so that a page can be displayed in a recognized format to the Web server, hence knowledge of some HTML is necessary. The Web server will send this document page to the browser to be displayed for the calling user. Table 29.1 shows some useful HTML tags.

29.4.1. Basic cgi script

All scripts should reside in the cgi-bin directory of your Web ...

Get Linux and Unix Shell Programming 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.