?
Solved

Hidden types and image maps

Posted on 1997-05-22
2
Medium Priority
?
182 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 200 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

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…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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 …
Suggested Courses

752 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