acidfish — 2010-08-01T07:48:24-04:00 — #1
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.
acidfish — 2010-08-07T14:32:00-04:00 — #2
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
atsea_webdesign — 2010-08-08T10:01:43-04:00 — #3
ed_seedhouse — 2010-08-02T15:46:22-04:00 — #4
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.
xhtmlcoder — 2010-08-08T05:35:33-04:00 — #5
As far as I remember you cannot mix both; SHTML with PHP in that sense, i.e. on the same page.
atsea_webdesign — 2010-08-01T16:50:02-04:00 — #6
scallioxtx — 2010-08-01T10:22:18-04:00 — #7
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)