24hr iterator

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
yshaf13
Forum Commoner
Posts: 72
Joined: Mon Apr 03, 2006 7:59 pm

24hr iterator

Post by yshaf13 »

hi can someone give me an example of a simple script that would change a picture every 24 hours?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Use cron, icron or whatever scheduling system your environment supports.
yshaf13
Forum Commoner
Posts: 72
Joined: Mon Apr 03, 2006 7:59 pm

re

Post by yshaf13 »

I'm writing this script for someone else and i don't know what his server supports, how can i do it just using php?
basically, I need to display that there was x amount of days and x amount of weeks since a target date and every day should be a new picture.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Just update a record in a database, or even a flatfile, with the timestamp of the last change. Then when the page is requested, check if that timestamp is more than 24 hours old :)
Post Reply