Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- newbie: timed alerts
December 1, 2005, 12:46 pm
rate this thread
planning on using php as my main site implementation tool, I thought it
would be a good place to start. I'm new to php, and am looking to setup
a small/medium sized PHP-mySQL driven site.
One of the aspects of this site will be that registered users will be
able to store times when they want to receive emailed alerts. These
times will be stored in the database...easy enough. My question is:
what's the best way to setup the functionality of triggering the
alerts? I don't really know where to start.
I would assume that I need to have some executable running in the
background that periodically (say once every minute) polls the
database, and acts on any scheduled alerts that have come due by
sending the emails. Also, since I need to run such a program, any
possibility of hosting this site on someone else's server is probably
I'm sure lots of people have dealt with similar situations. What's the
Like I said, it's not really a php question. But I would appreciate any
direction anyone would be willing to offer. Thanks in advance.
Re: newbie: timed alerts
The usual way to do this is with cron which allows you to run a program
at specified periods. You will have to check with your hosting service
whether they provide cron, many do.
1 minute intervals is probably a bit too much, do you *really* need the
email to go out on the exact minute? The hosting companys also get a
little nervous about such frequent processes. 5 minutes is usually enough.