long-term timed events possible?

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
bwv2
Forum Commoner
Posts: 83
Joined: Fri Jun 10, 2005 11:50 am
Location: AZ

long-term timed events possible?

Post by bwv2 »

This may be better served by a Java forum, but since I'm not sure what I'm looking for, I'll start here.

I want to create a timed event of sorts, which would be initiated by a user action, but that would not execute for a few days. This would obviously have to be server-side as the client session would be terminated before the event happens. Here's an example of something this could be used for:

1. user submits a page
2. (backend) timed event starts, time is set at 3 days, at which time the user will be emailed with a reminder.
3. On exactly the 3 day mark, a function fires an email to remind the user of something.

I know I could do this by checking if it's been 3 days yet every time someone loads some page, but that won't get me the to-the-second accuracy that I need. This type of thing, I imagine, would also be used by companies like ebay to know when an auction ends (and when to email the winner, etc).

Can anyone point me in the right direction?
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Look into cron jobs.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

You might be interested in http://en.wikipedia.org/wiki/Cron
Post Reply