next up previous contents
Next: Forms Up: Serving Information to Previous: Writing CGI scripts

Active Maps

One nice feature which is now supported by most graphical WWW clients is the ISMAP active map command, which can be associated with an HTML inline image. This tells the WWW client to supply the x and y coordinates of the point the user clicks on within the image.

For example, this HTML tells the client this image is an active map:

    <a href=/cgi-bin/imagemap/uk_map>
      <img src=uk_map_lbl.gif ISMAP>
when the user clicks on the map at, say, point (404,451), her client will submit a GET request to the server:
    GET /cgi-bin/imagemap/uk_map?404,451
For this to do anything interesting, the server must interpret
`` /cgi-bin/imagemap/uk_map'' as something special - a server script to be executed rather than a file to be retrieved. How the server decides this is a command depends on the type of server gif, but whichever server you run, the `` 404,451'' part will then be passed to the command as parameters.

When the server script is executed, it could generate output that is to be returned directly to the client - for instance the command could generate HTML directly as output. However the usual way imagemaps are used is to access other existing pages of HTML using HTTP redirection. This is where the server first returns to the client the URL of the place to look for the page corresponding to the place they clicked on the map, and then the client goes and requests this new URL (usually without bothering to ask the user).

We look at how to configure active maps for a few servers in chapter gif

Jon Crowcroft
Wed May 10 11:46:29 BST 1995