What is the best method to get a background image header/banner/title-bar to automatically and randomly change each time the page is opened. I read a PHP book that changed the image seasonally. What would be the best: flash, java, actionscript. or the php or anything else? I'm willing to explore and learn :eek: thx in advance for any ideas.
Expanding the idea. Can you mix-up a "shtml" site with PHP added onto a working shtml site? Out of curiosity... interest??? Thx for the help above and any to follow bellow
Well, just to be picky, I will point out that none of these techniques produce a "random" image, merely a "pseudo random" one, since no computer algorithm can produce a truly random sequence on it's own.
As far as I remember you cannot mix both; SHTML with PHP in that sense, i.e. on the same page.
I would use PHP for this. Flash and the likes are way to heavy tools to solve this relatively simple problem.
Assuming you have image1.jpg, image2.jpg, ... imageN.jpg, a simple snippet like this will do:
<img src="image<?php echo rand(1, 10); ?>.jpg" alt="" />
Or you could put all images in an array and pick one at random.
(code assumes you have 10 images)