Log In · Register

 
 
Closed TopicStart new topic
Very Confused!!!, I could use a bit of help please ><
astrofriends
post Apr 16 2009, 10:34 PM
Post #1


Newbie
*

Group: Member
Posts: 3
Joined: Apr 2009
Member No: 724,358



Okay. This is what's up:
I am image mapping my site menu.
I want one of the links to be a set of rotating links, like everytime you click it, it goes to a different random page off a list or something.
I know that there is a script for ad rotations, where it changes the image and link,
but here, I do not want to change the image, and I want it in the image mapping- is this even possible? Please help!! _unsure.gif
 
fixtatik
post Apr 16 2009, 11:18 PM
Post #2


Senior Member
******

Group: Member
Posts: 1,237
Joined: May 2008
Member No: 648,123



if you're using PHP, you could just apply a simple rotation script. place this anywhere on the page. the best spot is usually at the very top, before any other codes:
CODE
<?php
function randomURL() {
  $urls   = array(
    'http://www.google.com/',
    'http://www.createblog.com/',
    'http://www.myspace.com/'
  );
  $random = rand(0,count($quotes)-1);
  $url    = $urls[$random];
  echo $url;
}
?>

and your image map would look similar to this:
CODE
<img src="LINK IMAGE" alt="" usemap="#imagemap" />
<map id="imagemap">
  <area shape="rect" coords="0,0,0,0" href="<?php randomURL(); ?>" alt="" />
  <area shape="rect" coords="0,0,0,0" href="<?php randomURL(); ?>" alt="" />
</map>
 
astrofriends
post Apr 16 2009, 11:22 PM
Post #3


Newbie
*

Group: Member
Posts: 3
Joined: Apr 2009
Member No: 724,358



Okay! Thank you very much- this is perfect! It took me a minute to process what you were trying to say, but I understand now. Again, thank you for your help!
 

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: