Changing pictures after some interval

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
PHPnooob
Forum Newbie
Posts: 1
Joined: Tue Feb 03, 2009 4:28 pm

Changing pictures after some interval

Post 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!
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Changing pictures after some interval

Post 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.
User avatar
Skoalbasher
Forum Contributor
Posts: 147
Joined: Thu Feb 07, 2008 8:09 pm

Re: Changing pictures after some interval

Post by Skoalbasher »

I suggest you look into some javascript.

Edit. Forget my post
Post Reply