Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Closed Thread
trying to learn how to submit a form via an image map, and check POST with php
Old 08-05-2010, 08:07 AM trying to learn how to submit a form via an image map, and check POST with php
Webmaster Talker

Posts: 611
Trades: 0
hi, I've looked all over the net for solutions and none of the Javascript code snippets they said to add to the image map worked. I am trying to have an image map submit an empty form , and then I check if POSTED with PHP, and if it is posted, I output to the page, "cool it worked". Eventually this is going to be used to change images within a div when the user clicks on an image map it will change to the next image, linked image maps within a div. Not sure if that makes sense. Lol. Ok thanks, any help greatly appreciated. Derek

I tried this so far.

Code:
<?php
if(!empty($_POST['mapform']))
{
   echo "it worked!";
   
}




?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
 
<form action='aradia.php' method='post' name='mapform'>
  
<img src="aradia.jpg" width="256" height="328" border="0" usemap="#Map" />
<map  name="Map" id="Map"><area shape="rect" coords="5,176,81,249"  href="javascript:;" onClick="document.mapform.submit()"
 /></map>



</form>

</body>
</html>
silverglade is offline
View Public Profile
 
 
Register now for full access!
Old 08-05-2010, 10:34 AM Re: trying to learn how to submit a form via an image map, and check POST with php
Webmaster Talker

Posts: 611
Trades: 0
HAHA I GOT IT!! AND IT WORKS. MUHAHAHAH. here is the code someone helped me.

Code:
<?php
if(isset($_POST['checker']) && $_POST['checker'] == 'checked')
{
   echo "it worked !";
   
}



?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<form action="aradia.php" method="post" name="mapform" id="mapform">
<input type="hidden" name="checker" value="checked" />
   <img src="aradia.jpg" width="256" height="328" border="0" usemap="#Map" />
</form>

<map name="Map" id="Map">
   <area shape="rect" coords="5,176,81,249" href="javascript: void(0);" onclick="javascript: document.getElementById('mapform').submit();" />
</map>

</body>
</html>
silverglade is offline
View Public Profile
 
Closed Thread     « Reply to trying to learn how to submit a form via an image map, and check POST with php
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15590 seconds with 12 queries