Solved

Hidden types and image maps

Posted on 1997-05-22
2
180 Views
Last Modified: 2013-12-25
I'm trying to create an map of my state on my page using a
Perl CGI script.  I can create it and everything but the problem is in the .map file associated with the .gif file.  When a person clicks on a portion of the map I want to assign a number to a variable and pass it through.

My first try looked like this in the .map file:
 poly county=4 108,159 112,159 112,160 142,160 142,161
and like this in the script:
 print "<A HREF=\"http://www.someplace.com/cgi-bin/counties.map\">";
 print "<IMG SRC=\"/gifs/counties.gif\" ISMAP></A>";
     
My CGI script loops back to itself and I get the value of county using the CGI.pm library functions.  The previos example works but there are other variable that I need to pass through as hidden, but when I include the map, those hidden variables don't go through.

Then I tried this in the script:
(inside a form)
  <INPUT type=image src=yourimage.gif value="testvalue">

But then, the action described in the .map file is ignored.
So all the other variables go through, but not 'county' defined in the .map file.

QUESTION:
How do I either: 1)do the first example while having the ability to pass through the hidden variables (cookies?)
2)Use the second method and somehow coordinate the details in the .map file with the variables passed using the form.
0
Comment
Question by:webslider
2 Comments
 

Author Comment

by:webslider
ID: 1828062
Edited text of question
0
 
LVL 5

Accepted Solution

by:
icd earned 100 total points
ID: 1828063
First of all I would not use a server side image map but a client side one.
Just in case you don't know the format you can get details from:-

http://www.authors.com/imgmaps.htm

Next, I assume from your message that the html which contains the reference to the map is generated 'on the fly' by your script.

It is now a simple case to modify the output of the script to include the variables in the URL. For example:-

<AREA SHAPE=RECT COORDS="452,29,633,212" HREF="yourscript.pl?par1=$par1&par2=$par2">

Then when the script 'loops back' on itself it gets the coordinates as well as the parameters.

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question