Cetanu Posted July 30, 2009 Share Posted July 30, 2009 Is it possible to include PHP that will function in an image map? Or do I have too high expectations for PHP and image maps? XD If I could it would be awesome! Link to comment https://forums.phpfreaks.com/topic/168205-image-maps/ Share on other sites More sharing options...
lonewolf217 Posted July 30, 2009 Share Posted July 30, 2009 what exactly would you be trying to accomplish with this it would be possible if you wanted to say, echo a php variable into the mapping Link to comment https://forums.phpfreaks.com/topic/168205-image-maps/#findComment-887181 Share on other sites More sharing options...
Cetanu Posted July 30, 2009 Author Share Posted July 30, 2009 I have a website that people can join, and if I have an HTML tutorial made from an image map (it looks sleeker, etc.), but it would be cool if I could: <?php if($_SESSION['id']){ echo "Hello there, " .$_SESSION['username']; } else{ die("You must be signed in."); } ?> If I could execute that in the map or something it would be awesome! Is it possible? Link to comment https://forums.phpfreaks.com/topic/168205-image-maps/#findComment-887201 Share on other sites More sharing options...
lonewolf217 Posted July 30, 2009 Share Posted July 30, 2009 as far as I know, image maps are just used for creating areas of the image to click on to link to other places. to actually output text, you probably want to use CSS to align a div to a portion of the image and then just output this content into that div. something along the lines of this basic example where you have a div with a class "body" that is the size of your image. you then fill the image 100% of that div. then you have an absolutely positioned div within that image that contains the welcome information you want <html> <head> <style type="text/css"> .welcome { position:absolute; top:5%; right: 5%; width:100px; height:50px; } </style> </head> <body> <div class="body"> <image src="\images\test.gif" height=100% width=100%> <div class="welcome"> <?php if($_SESSION['id']){ echo "Hello there, " .$_SESSION['username']; } else{ die("You must be signed in."); } ?> </div> </div> </body> </html> Link to comment https://forums.phpfreaks.com/topic/168205-image-maps/#findComment-887207 Share on other sites More sharing options...
Cetanu Posted July 30, 2009 Author Share Posted July 30, 2009 Okay, that's what I thought, but I also thought maybe there would be a way to put it directly in the map. Thanks! Link to comment https://forums.phpfreaks.com/topic/168205-image-maps/#findComment-887251 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.