Introduction to Forms

HTML form tags merely provide an interface and controls for gathering information. The real work is done by forms-processing applications, usually CGI scripts, behind the scenes. CGI (Common Gateway Interface) is the interface between HTTP (the program responsible for web transactions) and other programs on the server.

A CGI program (or script) can be written in a number of programming languages. It doesn’t matter to the server which one, as long as it can retrieve data and send data back. On Unix, the most popular language is Perl, but C, C++, Tcl, and Python are also used. On Windows, programmers write scripts in Visual Basic, Perl, and C/C++. On the Mac, AppleScript and C/C++ are common.

If you are coming at web design from a designer’s point of view (or even just as a novice to web design), chances are you will be handling the HTML form elements and leaving the programming to trained programmers. Often, ISPs will provide a few canned CGI scripts, such as a guestbook or mailing function, that you can point to from within your form, but if you want something customized for your site, I recommend you hire a professional programmer to write it for you.

CGI programming is certainly beyond the scope of this book, but if you are interested in reading more, try CGI Programming for the World Wide Web, by Shishir Gundavaram (O’Reilly & Associates). For information on customizing existing scripts, see Section 12.8 at the end of this chapter.

Get Web Design in a Nutshell 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.