|
Posted by Stefan Rybacki on 07/21/05 23:05
Johan wrote:
> I am using a mysql db
>
>
So what about this:
emails are stored in a database.
say the table holding the emails contains the following columns:
id, email, activationkey, sent, activated, senttime
in your php script that sends activation emails (e.g. sendactivationmails) you just get
all emails that are not already sent and those that are sent but not activated after a while.
Now you send your activation emails to each retrieved email with an activation key (you
create before sending e.g. by calling $key=md5(time().$email.random data); and the id
attached to a link like this:
http://www.foobar.com/activateemail.php?id=$id&key=$key
after successfully sending the email you update the activationkey and the senttime in your
database.
the second script e.g. activateemail.php retrieves an id and a key, which you check in
your database and if they match you set the activated attribute.
Any questions?
Regards
Stefan
Navigation:
[Reply to this message]
|