Forum Moderators: coopster

Message Too Old, No Replies

Image Mapping and Passing Variables

         

DontheCat

8:01 pm on Aug 30, 2005 (gmt 0)

10+ Year Member



I have this Map of my State and I've created hotspots for each of the 23 Districts within.

I want the User to click on a particular Spot, which would go to a page where the members for that state would be displayed using that District ID as the Search Key.

I guess I can pass on a Form Input data to another page as Hidden values, but how do I do it in this case?

Morover, DW gives one common Map ID for the entire image and different co-ordinates. How then would I able to allocate the District IDs for each Spot?

Thanks for the support

King_Kong

10:33 am on Aug 31, 2005 (gmt 0)

10+ Year Member



Don't use POST use GET.

so...

<area ... href="page.php?action=blah&district_id=#*$!">

henry0

12:07 pm on Aug 31, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That should work with a DB

$id=$qry[id];
echo "<area shape=rect coords='1,1,117,35' href='new_content_logo.php?new_content=$id'>";
######################################################################
session_start(); // pass the username
$logo_rect =$_POST['logo_rect']; // input from above map

if (isset ($logo_rect) &&!empty ($logo_rect))

// It's an update
{
$sql = "update XXXtable
set logo_rect ='$logo_rect',
created = '$time',
modified = '$time'
where username='$username' ";


$result = mysql_query($sql, $conn);
}

//@@@@@@@@ Use isset() to check that $_POST is not empty, sending empty value

if (isset ($result) &&!empty ($result))
{

echo "<INPUT TYPE=SUBMIT VALUE='Submit'><br>";

echo" any texts or use header
}
if (!$result) {
print "There was a database error when executing <PRE>$sql</PRE>";
print mysql_error();
exit;
}
?>

DontheCat

6:52 pm on Aug 31, 2005 (gmt 0)

10+ Year Member



Thanks for the replies.

However, what I did was pass the variable along with the <a href....> in the area co-ordinates generated when I create the Hotspot.

I GET the variable in the next page