|
Posted by Jim Moseby on 10/15/28 11:17
What I do is generate a random key, save it in the database, send them an
email with a link that they must click to validate their email:
http://www.mysite.com/validate.php?email=you@somehost.com&key=ayunj83J#@8h3j
9j(*(hn3983n*(j
Its not foolproof, I know, but it is simple and effective, as you say.
Heres a quick and dirty function to generate the key:
function KeyGen($length){ // Generates random, mixed case, alphanumeric
string of $length characters.
for($len=$length,$r='';strlen($r)<$len;$r.=chr(!mt_rand(0,2)?mt_rand(48,57):
(!mt_rand(0,1)?mt_rand(65,90):mt_rand(97,122))));
return $r;
}
JM
> -----Original Message-----
> From: Mário Gamito [mailto:lists@tuxdoit.com]
> Sent: Friday, May 20, 2005 5:13 AM
> To: php-general@lists.php.net
> Subject: [PHP] How to confirm subscriptions by e-mail on a PHP site ?
>
>
> Hi,
>
> I'm making this middle-range site (i. e., not so little, bit
> not so big,
> either), and i want users that subscribe to my site to have their
> confirmation made by email.
>
> Does anyone sugests a simple, yet effective way to do this ?
>
> Please, don't misunderstand me.
> The PHP part i know.
> The sugestions i'm asking for are about the mechanism.
>
> Thanking you in advance.
>
> Warm Regards,
> Mário Gamito
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
[Back to original message]
|