Solved

Hidden types and image maps

Posted on 1997-05-22
2
181 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

717 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