Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cool website feature - how do I do it?

Status
Not open for further replies.

shanona1

Technical User
Dec 13, 2004
34
US
On this website ( if you refresh it, or everytime you go to the website, there's a certain part of the site that changes. I want to know how they do it, so I can recreate that for my own site. Thanks in advance for any advice!
 
From viewing their source code, it would appear that they handle this server side.

That is, whatever is generating their page is choosing a random number (1, 2, or 3 is my guess) and writing the HTML to point at the particular directory where the chosen picture(s) can be found.

'hope this helps... somewhat.

--Dave


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
That's how I do it on my site. I randmly select numbers from a list, then display whatever information I have assigned to that number. It's all processed server side via ColdFusion.



Hope This Helps!

ECAR
ECAR Technologies, LLC

"My work is a game, a very serious game." - M.C. Escher
 
Hi

Just as another way to do similar things. On my site the ads looks to be displayed randomly, but they are not. I have 60 ads with numbered names and is included the one with the name matching the current time's seconds.

shanona1, would be better to tell us what server side scripting is available, if any, on your server. This way we could give practical solutions instead of theory.

Feherke.
 
You could do it client-side as well, with some Javascript. I'm using JS to put a random quotation on some of my pages, for example. Just be aware that some visitors may have javascript switched off, so they won't see the random content.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
If you're using IIS, check out the ContentRotator object.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top