|
|
WWW SCRIPTING These sections provide information about CGI scripting, using Perl as an example. One of the most powerful features of HTTP servers lies in their ability to run programs behind the scenes and return the results of these programs to the client. This is known as common gateway interface (CGI) scripting. Basic CGI scripts include the ability to display the current time or the number of users who have accessed a server. More advanced and useful CGI scripts allow readers to search databases, complete survey forms and have them sent to an email address, implement imagemaps, or take pictures of remote places and have the pictures returned. CGI scripts are made available to a Web browser through the use of simple links, specialized URLs containing a question marks (?), ISINDEX HTML tags, or HTML+ FORMs. After the user submits an HTML document containing one of these elements, a query is passed to the HTTP server, which is passed on to the CGI script itself. The script processes the input, formats the output into HTTP codes and/or an HTML document, and returns these items back to the HTTP server. The server then passes it along to the client application. CGI scripts can be written in almost any language. Common languages include C, Perl, AppleScript, VisualBasic, and Unix shell scripts. This section outlines how to write simple CGI scripts using Perl. Perl is freely distributed, runs on just about any computing platform, includes functions for doing TCP communications, and has complete string manipulation functions. Most importantly, Perl is has one of the best support groups available anywhere, the Internet. Keep in mind that Perl may not be the best CGI scripting language for your particular need. It is always a good idea to use the best tool for your particular job and other scripting languages may provide more useful hooks to your server's operating system. |
|
SUBECTIONS |
|
SEE ALSO |
|
Version: 1.5
Last updated: 2004/12/23. See the release notes.
Author: Eric Lease Morgan (eric_morgan@infomotions.com)
URL: http://infomotions.com/musings/waves/