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/[EMAIL PROTECTED]&[EMAIL PROTECTED]
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:[EMAIL PROTECTED]
> 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
> 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to