|
Posted by Jim Moseby on 10/21/52 11:26
>
> -----Original Message-----
> From: Jim Moseby [mailto:JMoseby@nrbindustries.com]
> Sent: Monday, September 12, 2005 8:56 AM
> To: 'bedouglas@earthlink.net'; php-general@lists.php.net
> Subject: RE: [PHP] confirmation email script/code
>
>
> > has anybody come across a really good 'open source' chunk
> of code for
> > sending/recieving confirmation emails from an app... i'd like
> > to allow the
> > user to register, and send them an email that they then have
> > to hit the link
> > to complete the process..
>
> It is strightforward to write this yourself. In my simple example, I
> generate a 32 byte random ID when the user registers and save
> it along with
> his data in the DB. Then, I send him an email with a link like this:
>
> www.example.com/register.php?id=7H7dh869ha320J6GhAs89L0lJ00j09
> df?action=conf
> irm
>
>When he clicks the link, I flip a flag in his DB record that he has
>confirmed.
>
>I have cron periodically go and clean up unconfirmed records that have
timed
>out.
>
>JM
>
> jim...
>
> pretty much what i had thought about... question.. how does
> one correctly!!!
> set up a cron process...
>
> i assume that i can write a quick perl/php app that iterates
> through the
> 'emailconfirmTBL' looking at the date, and the confirm status. if the
> cleanup app sees any records that are over a certain age, and
> haven't been
> confirmed, it can simply delete the record. but shouldn't the
> cleanup also
> do a rollback/delete of the user registration records as well...
>
> this kind of approach would lend itself to being monitored by
> an admin who
> could then look to see where in the process a given user is/was...
>
> any good/quick guides you can point me to!
>
Yeah, whatever you need to do to keep your DB happy. What I did was write a
php script that shuffles through the database and deletes any registration
records from the `users` table that weren't confirmed within 7 days of
sign-up. Then set up a cron job (see "man crontab") that runs it once per
day. It emails me a report about what it did when it's done.
JM
Navigation:
[Reply to this message]
|