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? Quote 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. Quote 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>"; Quote 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. Quote 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.. Quote 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>'; ?> Quote 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! Quote 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> Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.