set cron jobs with php script?
Posted: Thu Jul 05, 2007 7:52 pm
Here's what I have:
A user submits a page using a form. The page takes the user input and places it in a MYSQL database. It also calculates a time 3 days in the future and writes it to the user's mysql row. The user leaves on his or her merry little way.
Here's what I want next, but don't know how:
As soon as that future time is reached, a php script will be executed. The contents of the executed script are irrelevant- it's how to get it to call the script at the right time without being prompted by a user calling a page that's causing me strife.
I have looked into cron jobs a little (I'm new to the concept). Could I write one cron job now that would last forever, and that would automatically run a script that checks the db for expired future dates? If so, how do I get the cron job to do this? And how do I write a cron job? (I do have admin access to the server).
I hope that makes sense. I'm a little lost.
A user submits a page using a form. The page takes the user input and places it in a MYSQL database. It also calculates a time 3 days in the future and writes it to the user's mysql row. The user leaves on his or her merry little way.
Here's what I want next, but don't know how:
As soon as that future time is reached, a php script will be executed. The contents of the executed script are irrelevant- it's how to get it to call the script at the right time without being prompted by a user calling a page that's causing me strife.
I have looked into cron jobs a little (I'm new to the concept). Could I write one cron job now that would last forever, and that would automatically run a script that checks the db for expired future dates? If so, how do I get the cron job to do this? And how do I write a cron job? (I do have admin access to the server).
I hope that makes sense. I'm a little lost.