Rotating Banners when page is hit by surfers

L

Leland

I am needing to set up one spot for banners to be displayed, then have
multiple banners rotate in order only when the page is visited. In other
words, one surfer hits the home page (where the banner is displayed) and the
first banner is displayed. A second surfer them hits the same page, the
second banner comes up. This cyle continues in a specified order then
repeats when all banners have been displayed.

Can you tell me how to get started setting this feature up? Thanks. I've
read other posts concerning other issues and you guys are a great help!
 
T

Trevor L.

Leland said:
I am needing to set up one spot for banners to be displayed, then have
multiple banners rotate in order only when the page is visited. In
other words, one surfer hits the home page (where the banner is
displayed) and the first banner is displayed. A second surfer them
hits the same page, the second banner comes up. This cyle continues
in a specified order then repeats when all banners have been
displayed.

Can you tell me how to get started setting this feature up? Thanks.
I've read other posts concerning other issues and you guys are a
great help!

I know how to dsiplay images in a *random* order

This is some simple code which displays images on my website. You would have
to substitute your own
<html>
<head>
<script type="text/javascript">
function selectimg()
{
no=Math.round(Math.random()*8)
document.images('imgno').src
= (no == 1) ? "images/display/trevor-and-carole.gif"
: (no == 2) ? "images/display/pictures.gif"
: (no == 3) ? "images/display/map.gif"
: "images/display/hearts.gif"
}
</script>
</head>
<body onload="selectimg()">
<img id= "imgno" src=""></a>
</body>
</html>

But to display them in a set order is more difficult. I think you would have
to have a database on your server. Every time someone visits, a number is
extracted from the database and that number used to determine which image to
display. The number would then be incremented by 1 and stored back in the
database for the next vistitor. (Of course the code which increments the
number would also have to say "If incremented number is greater than the
number of images, then set number to 1.)

As my server does not support databases, I have no experience to guide you.
Two thoughts:
1. Another may reply
2. Is it important that the images be presented in a set order or is a
random order good enough ?
(If not, the code above will work)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top