Jump to content

Image Maps


Cetanu

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.