RE: [PHP] Random String Generation
| From: | John W. Holmes | Date: | Thu, 13 Mar 2003 01:29:32 +0000 |
| Subject: | RE: [PHP] Random String Generation | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139424@lists.php.net to get a copy of this message | ||
> What I am trying to do is to create a email verification routine with
PHP.
> When people register on the site they will get an email sent to them
with
> a
> link such as
http://mysite.com/activation.php?ID=ghjghjg367ghjlkj9hjlkjhn0
>
> That way when they click on the link it will verify the code against
the
> database and activate their account. Does anyone know an easy way to
> create
> this string?
Use uniqid(). The manual page shows you how to create one along with
md5() that'll be 32 chars (128 bits) long. Pretty hard for someone to
guess.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/