PDA

View Full Version : Random banner display



Saratoga Sam
04-27-2006, 05:16 AM
Hi -

I'm looking for a script that allows me to randomly display a dozen ad banners that are in .jpg, .gif and .swf (flash) formats.

Any help would be greatly appreciated!

Thanks

djr33
04-27-2006, 11:04 AM
I'd do this serverside rather than clientside. (php, not JS).
there's nothing wrong with JS, except that it's not compatible, and, for me at least, the php would be easier.

Also, JS is memory intensive for the user... seems like it's not worth doing it to me (through JS, that is), but totally your choice.

Basically... create an array or something like that, then a random number, from 1-12, then use the array component matching the random number you get, and display that. You're done.