12-10-2007, 08:43 PM
|
#2 (permalink)
|
|
The Acquainted
Join Date: Sep 2007
Location: Leeds, UK
Posts: 141
Thanks: 6
|
I have mine select from a range of 1 to 999 and then MD5 hash encrypt it and then cut it down to just a length of 6 instead of 32.
PHP Code:
$length = isset($_GET['chars']) ? $_GET['chars'] : 6; // Let's generate a totally random string using md5 $hash = md5(rand(0, 999)); // We don't need a 32 character long string so we trim it down to 5 $code = substr($hash, 15, $length);
__________________
Not quite a n00b...
|
|
|
|