- 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
Webmaster Mbtradingco wrote:
> 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?
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php