Page 1 of 1

Changing pictures after some interval

Posted: Tue Feb 03, 2009 4:42 pm
by PHPnooob
Hi,
Is there a way to change a picture after some time, let's say 1 hour? I want to use the same place for many banners and cycle them. I'm thinking about using array of strings like this: "<a href="..."><img src="..." /></a>" and a for loop. I would use current system time for initializing counter variable(start_time) and change array element when current time is greater than start_time for some number. For 1h interval I guess it would be 60*60*1000. Is it possible to do it like this or is there a smarter way? :)
P.S. I need it on server side, won't use JavaScript.
Thanks in advance!

Re: Changing pictures after some interval

Posted: Tue Feb 03, 2009 9:17 pm
by requinix
Smarter way? Not really.

No need for a start time though. What if you changed images on the hour? Removes some of the complexity.

Re: Changing pictures after some interval

Posted: Wed Feb 04, 2009 8:33 am
by Skoalbasher
I suggest you look into some javascript.

Edit. Forget my post