Jump to content

timed image rotation?


clown[NOR]

Recommended Posts

i've been trying to figure out how to create a timed image rotation. search these forums, but i got "No matches found" .. so i turn to you guys to ask for help... again! =) basicly i've got 5 banners, and i want to show a random banner every 5 minute on the website.. it doesnt have to automaticly change, just if the user refresh. but if the user refresh before the 5 min interval has passed he will see the same banner.

 

Anyone with an idea on how to make this?

 

Thanks In Advance

- Clown

Link to comment
https://forums.phpfreaks.com/topic/88809-timed-image-rotation/
Share on other sites

You should use a database with two tables. One table for the actual images, and another table that logs the time that the user has spent on the site. Every time the user loads a page, or refreshes, check against the log to see how long the user has been on the site, and if it is longer than 5 mins, insert picture = x, and update the log with the new image time, repeat. Once the number of pictures has been used, have it start at pic #0 again.

 

 

Link to comment
https://forums.phpfreaks.com/topic/88809-timed-image-rotation/#findComment-454904
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.