nutt318 Posted February 13, 2009 Share Posted February 13, 2009 The below code works with only one mapping for a button. When I add the second map for another Hotspot on the same image it executes both PHP scripts. Is there something that I have out of place? Just need some help getting this thing to work right. Thanks. <body> <img src="control.png" width="600" height="350" border="0" usemap="#Map" /> <map name="Map" id="Map"> <area shape="rect" coords="42,9,104,30" href="#" onclick="javascript:document.frm1.submit();" /> <area shape="rect" coords="6,35,68,56" href="#" onclick="javascript:document.frm2.submit();" /> </map> <?php if($_POST['Submit']){ $open = fopen("commands.dat","a+"); $text = "81\n"; fwrite($open, $text); fclose($open); } echo "<form name='frm1' action=\"".$_SERVER['http://mysite.com/wordpress/control.php']."\" method=\"post\">"; echo "<input name=\"Submit\" type=\"hidden\" value=\"Submit\" />\n </form>"; ?> <?php if($_POST['Submit']){ $open = fopen("commands.dat","a+"); $text = "82\n"; fwrite($open, $text); fclose($open); } echo "<form name='frm2' action=\"".$_SERVER['http://mysite.com/wordpress/control.php']."\" method=\"post\">"; echo "<input name=\"Submit\" type=\"hidden\" value=\"Submit\" />\n </form>"; ?> </body> Link to comment https://forums.phpfreaks.com/topic/145084-image-hotspot-using-php/ Share on other sites More sharing options...
nutt318 Posted February 13, 2009 Author Share Posted February 13, 2009 I'm out of ideas, does anyone have any suggestions? I've been change different things and googling the crap out of it but nothing. Thanks. Link to comment https://forums.phpfreaks.com/topic/145084-image-hotspot-using-php/#findComment-761623 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.