Solved

Hidden types and image maps

Posted on 1997-05-22
2
176 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
Comment Utility
Edited text of question
0
 
LVL 5

Accepted Solution

by:
icd earned 100 total points
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
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…
The viewer will learn how to count occurrences of each item in an array.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

771 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now