Plain old HTML is very static and unchanging. CGI is an attempt to allow a static web page to interface with a web server. Basically, a web page is static and the CGI interface is dynamic.
For example, if you wanted to look up a customer number, you could write a small routine in CGI to do so. This routine would transmit the customer number back to the server, which would query the database and send it back to the web page for display.
This is a simple example of CGI, which is actually extremely powerful. There is virtually no limit to what you can implement with this technology.
It is important to remember that CGI is the technology of allowing a web page to run scripts or programs on the server. The actual language in which a CGI routine is written can vary. Perl is very popular, as is C and C++. Other languages such as TCL may also be used.
It’s important to understand that CGI is not a language in itself. It is instead a specification for allowing the web page to communicate with a web server. You can write CGI applications in just about any language, including Fortran, C++, TCL, Visual Basic, Applescript or Perl. some of these languages are compiled and some can be run as script.
For security reasons, CGI code must run out of a special directory on the server, generally called cgi-bin. The webmaster will install CGI programs for you in this directory.
There are many books all about how to program in any number of CGI languages. One excellent one is “Developing CGI Applications with Perl”, and another is shown to the right. PERL is one of the most used scripting languages, and it is often favored because it does not need to be compiled.
There is much more to CGI than I can teach you here, and there are many very good references and sites for you to read and explore. The point is that CGI is an option, especially if you have some control over the server.
One of the main drawbacks to CGI is the difficulty of convincing a webmaster to install your applications. There are security risks associated with CGI routines (since they do run on the server) and most webmasters will not allow user-written CGI routines. This is especially true of the free hosting companies.