sarkocreme Posted October 16, 2007 Share Posted October 16, 2007 echo "<area shape='rect' coords=",$a*6,$b*6,$a*6+5,$b*6+5," href='move.php' title='Test'> <area shape='default' nohref>"; I'm using to input variables into the coordinates. It basically does nothing as is. Does anyone have any suggestions? Link to comment https://forums.phpfreaks.com/topic/73423-solved-variable-coords-in-image-map/ Share on other sites More sharing options...
sarkocreme Posted October 16, 2007 Author Share Posted October 16, 2007 Still looking for help on this topic or what to search for to find answers. Thanks. Link to comment https://forums.phpfreaks.com/topic/73423-solved-variable-coords-in-image-map/#findComment-370888 Share on other sites More sharing options...
BlueSkyIS Posted October 16, 2007 Share Posted October 16, 2007 you can't do math substitution in a quoted string like that. you'll need something more like: echo "<area shape='rect' coords='".($a*6).",".($b*6).",".($a*6+5).",".($b*6+5)."' href='move.php' title='Test'><area shape='default' nohref>"; Link to comment https://forums.phpfreaks.com/topic/73423-solved-variable-coords-in-image-map/#findComment-370891 Share on other sites More sharing options...
sarkocreme Posted October 16, 2007 Author Share Posted October 16, 2007 That makes more sense but it's still not working with that code (as in you can't click anywhere on the image). Any other suggestions? I appreciate the help. Link to comment https://forums.phpfreaks.com/topic/73423-solved-variable-coords-in-image-map/#findComment-370901 Share on other sites More sharing options...
kpesanka Posted October 16, 2007 Share Posted October 16, 2007 Can you show the HTML page that uses his code that doesn't work? The code looks fine to me.. Link to comment https://forums.phpfreaks.com/topic/73423-solved-variable-coords-in-image-map/#findComment-370915 Share on other sites More sharing options...
sarkocreme Posted October 16, 2007 Author Share Posted October 16, 2007 www.finalnod.com/testmap.php The full code of that file is: <? echo"<IMG SRC='map.php' border='0' usemap='#shapes'> <map name='shapes'>"; for($a=0; $a<=40; $a++) { for($b=0; $b<=40; $b++) { echo "<area shape='rect' coords='".($a*6).",".($b*6).",".($a*6+5).",".($b*6+5)."' href='move.php' title='".$a.",".$b."'><area shape='default' nohref>"; } } echo '</map>'; ?> Link to comment https://forums.phpfreaks.com/topic/73423-solved-variable-coords-in-image-map/#findComment-371141 Share on other sites More sharing options...
sarkocreme Posted October 17, 2007 Author Share Posted October 17, 2007 Well that was a silly mistake. Realized it as soon as I got home and had time to really look at it. Having that default show up in the FOR loop nullified all the new coordinates. Thanks for the solution! Link to comment https://forums.phpfreaks.com/topic/73423-solved-variable-coords-in-image-map/#findComment-371233 Share on other sites More sharing options...
marcus Posted October 17, 2007 Share Posted October 17, 2007 Why not just make it a map? <a href="file.php"><img src="src.gif" border="0" ISMAP></a> Link to comment https://forums.phpfreaks.com/topic/73423-solved-variable-coords-in-image-map/#findComment-371240 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.