215 218




Apache Server for Windows Little Black Book:Image Maps And Redirection
function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) { var end = document.cookie.indexOf (";", j); if (end == -1) end = document.cookie.length; return unescape(document.cookie.substring(j, end)); } i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } var m1=''; var gifstr=GetCookie("UsrType"); if((gifstr!=0 ) && (gifstr!=null)) { m2=gifstr; } document.write(m1+m2+m3);            Keyword Title Author ISBN Publisher Imprint Brief Full  Advanced      Search  Search Tips Please Select ----------- Components Content Mgt Certification Databases Enterprise Mgt Fun/Games Groupware Hardware IBM Redbooks Intranet Dev Middleware Multimedia Networks OS Prod Apps Programming Security UI Web Services Webmaster Y2K ----------- New Titles ----------- Free Archive To access the contents, click the chapter and section titles. Apache Server for Windows Little Black Book (Publisher: The Coriolis Group) Author(s): Greg Holden with Matthew Keller ISBN: 1576103919 Publication Date: 01/01/99 function isIE4() { return( navigator.appName.indexOf("Microsoft") != -1 && (navigator.appVersion.charAt(0)=='4') ); } function bookMarkit() { var url="http://www.itknowledge.com/PSUser/EWBookMarks.html?url="+window.location+"&isbn=0"; parent.location.href=url; //var win = window.open(url,"myitk"); //if(!isIE4()) // win.focus(); } Search this book:  















Previous
Table of Contents
Next




For example, if the client requests a file called speech.html and the directory in which MultiViews has been enabled contains only speech.fr.html, speech.de.html, and speech.it.html, Apache will look at the Accept-Language header information sent by the browser to determine the most desirable variant. If no variant is specified, Apache will use the languages specified by the LanguagePriority directive to decide which one to serve (see “Establishing Language Priority” earlier in this chapter).
Using mod_imap To Process Image Maps
The module mod_imap has largely replaced CGIs as a way for Apache to process server-side image maps. To use mod_imap, follow these steps:


1.  Choose a file extension to use with image-map configuration files; the common choice is .map.
2.  Open srm.conf in Notepad.
3.  Scroll down to the AddHandler section of srm.conf and un-comment this line:


#AddHandler imap-file map


This tells Apache to use the handler imap-file, which is used by mod_imap, with image-map files ending in the .map file-name extension.
4.  Choose File|Save to save the changes, and restart Apache.

Once you have configured Apache to use mod_imap, you need to create the image map itself. The process of creating an image map can be summarized in three general steps:


1.  Select the image.
2.  Trace the clickable regions on the image using special image-map software. You can download some programs from the Web; this feature is also built into some advanced Web-page authoring tools.
3.  Add HTML instructions for the Web page that is to contain the map.

One image-map program for the Macintosh, WebMap, is shown in Figure 10.2. Like most image-map programs, WebMap lets you define the shape of each clickable region by marking the x,y coordinates of the region’s corner points, and it shows you the coordinates as you draw the image. The size of each shape you draw is described geometrically by the software you use. The upper-left corner of a rectangular image, for instance, is assigned the x,y coordinates 0,0, and the lower-right corner has other coordinates (such as 103,59, for the graphic shown in Figure 10.2).

Figure 10.2  Two sets of x,y coordinates (0,0 and 103,59) define the size of the image.

An image-map program describes the clickable regions in an image map by using directives that mod_imap can then process:


•  base—Specifies the base for any relative URLs used within the map file. The default is http://server_name/.base_uri.
•  default—Tells Apache what action to take when the user clicks on an area that is not inside any rectangle, polygon, or circle defined in the image-map file. The default value is nocontent, which tells the client to stay on the page being displayed.
•  poly—Defines a polygon by using at least three points.
•  circle—Defines a circle by using the center coordinates and a point on the circle.
•  rect—Defines a rectangle by defining two opposite corner coordinates.
•  point—Defines a single point.

As an alternative to using the base and default directives specified in the preceding list, you can also use two of the three directives provided by mod_imap:


•  ImapDefault—Specifies the default action for the image map.
•  ImapBase—Identifies the default base URL to be referenced by the relative URLs in the image-map file.

The third mod_imap directive, ImapMenu, lets you specify how Apache should respond to a request for an image-map file that does not have any valid coordinates or for an image-map file that a text-only browser wants to display. ImapMenu takes a single argument, which tells Apache which kind of menu file to return to the browser:

•  none—No menu is displayed.
•  formatted—A formatted document is displayed without comments. The formatted document consists of a heading, a horizontal rule, and then the links in the image-map file, each on its own line.
•  semiformatted—The links in the image map are displayed and commented text is formatted. No heading or horizontal rule is included. For example, suppose you include Imap semiformatted in your access.conf or .htaccess file and your image-map file contains the following (an example is shown in Figure 10.3):


base referer
#<H1>Our Company</H1>
circle mission.html 25,25 0,25 "Our mission"
rect personnel.html 60,0 100,60"Staff listings"
#Select one of the options shown above



Figure 10.3  Apache can be configured to display this image-map menu to text-only browsers.
•  Unformatted—Comments are printed and blank lines are ignored. No heading or horizontal rule is included.

After the image-map file is created and saved with the file-name extension .map, the final step is to make a reference to the .map file in the HTML for the Web page that is to contain the image map; for example:



<A HREF="/docs/image.map"><IMG SRC="/graphics/
imagemap.gif" ISMAP></A>


The ImapMenu, ImapDefault, and ImapBase can all be specified on a serverwide basis, with a virtual host, within <Directory> or <Location> containers or within .htaccess files.



Previous
Table of Contents
Next






Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited.



Wyszukiwarka

Podobne podstrony:
215 218
215 218
218 (2)
218 219
215 Bibliografia załącznikowa II
Dz U 2008 nr 215 poz 1366
v 04 218
214 215
212 215
215 Rozporz dzenie Rady Ministr w w sprawie sposobu i trybu zawarcia

więcej podobnych podstron