Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.