Re: Timed Jobs.
| From: | J Smith | Date: | Wed, 20 Feb 2002 15:46:57 +0000 |
| Subject: | Re: Timed Jobs. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-85542@lists.php.net to get a copy of this message | ||
Suggestion:
- When the user triggers the event, store their user name, email or
whatever along with a timestamp in your site's database (if it has one) or
in some text file some place.
- Write a cron script that runs every five minutes, every minute, every
hour, whatever. When this script runs, it reads the aforementioned
database, text file, etc. and checks the timestamps and the user data.
- If the data found by the above script (the timestamp and the user data)
matches a certain criteria (i.e. the timestamp is 5 hours old, or whatever
your delay is) and sends out the email appropriately, then deletes or
otherwise updates that record, so it doesn't try again when it runs the
next time.
J
Webmaster Mbtradingco wrote:
> Hi:
>
>
>
> I was wondering if it is posible to make in PHP a cron job, that will
> trigger an event (i.e. send an e-mail) long after the process of the
> data has taken place, like programming an e-mail to go out, on an
> specified date.
>
>
>
> My question is, since the script is run and triggered by the user, how
> can u trigger the later sending of the mail?
>
>
>
> Thanks.