|
|||||||||
|
Processing image map inputSetting up image maps is discussed in Chapter . When the user clicks on an image map, the coordinates of the position clicked are passed to the server as a query string, which is appended to the URL. A script invoked by the server to process the request is free to do anything it wishes. It may ignore the coordinates if desired. It is usual to perform some sort of mapping based on the coordinates. If this mapping is to another existing document, the script can redirect the request by outputting a Location header. An image map request can be serviced by any script, but there are programs distributed with the CERN and NCSA servers that are designed to handle the simplest cases. The htimage program is part of the CERN distribution and imagemap is part of the NCSA distribution. You do not have to use the program that came with the server. In fact it is fine to install both programs, or to use either of the programs with other servers. The NCSA imagemap program requires all image maps to be registered in a central configuration file. By default this file is located in:
/usr/local/etc/httpd/conf/imagemap.conf This location may be changed when the program is compiled. The file consists of a set of image map names and the corresponding image map files. The format of each line is as follows:
image-map-name : image-map-file-name The CERN program takes the pathname of the image map file as a command line argument so this can be specified as the path info part of the URL.
Next: Searching of indexes Up: Writing CGI scripts Previous: Processing input from
Spinning the Web by Andrew Ford |
||||||
Copyright © 1996-2002 Ford & Mason Ltd |