Sometimes, though, using a clickable image really is the best way to make your page look smart and simple to use. Fortunately, it's not hard to set up an image map, but it does need a little bit of planning.
First, you need to understand how the web server handles maps - and different servers work in different ways. Most commercial web space providers use one of two servers, called the NCSA or CERN http daemons, after the places where they were written. We'll show how to make an imagemap work with both. Even so, things will differ from one server to another, and if you're renting web space, you should check with your provider to find out which type of server you'll be using, and exactly how to set things up.
To make an picture into a map, there are two things that you must do to it. The first is to state that it's a map when you add it to your web page with an 'img' tag, and the second is to make it a link to a script on the web server. Scripts are a way that a web server can process information and return the results to your browser. They could be used, for example, to search through a database, or see how much disk space is free on the server.
The imagemap program is a special script that looks at the co-ordinates where you clicked and works out which web page you should see next. It does that by reading a map file, which is a description of the shapes in the image, and which URL should appear for each shape. If your provider is using the NCSA web server, the image mapping program is called /cgi-bin/imagemap, and if they're using the CERN server, it's called /htbin/htimage.
In next month's article we'll look at how to use scripts in more detail, but for now we'll just look at how to call the image mapping program and tell it what parts of your image lead to which type of link.
Scripts are called as a special type of URL, giving the name of the script, followed by a slash and the rest of the parameters. In the case of an imagemap, you have to tell the server the name of the file that contains a description of your picture, and your web browser will add the co-ordinates on the end. Here's an example, for the NCSA web server
<a href="/cgi-bin/imagemap/test.map"> <img src="map.gif" ismap></a>
In other words, the graphics are in a file called map.gif, and the file test.map describes which areas are clickable. For the CERN server, all you have to do is change the name of the mapping program.
![[ NEXT ]](n.gif)
![[ LAST ]](l.gif)
![[ PART 1 ]](p1.gif)
![[ PART 2 ]](p2.gif)
![[ PART 3 ]](p3.gif)