Jump to content


Photo

Random 6char keygen


  • This topic is locked This topic is locked
No replies to this topic

#1 Demonic

Demonic
  • Members
  • PipPipPip
  • Advanced Member
  • 562 posts

Posted 08 September 2006 - 11:11 PM

anyone know how to make one i know randnumbers not characters.Characters only.
nvm
<?php

$length    = 7;
$key_chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$rand_max  = strlen($key_chars) - 1;

for ($i = 0; $i < $length; $i++)
{
   $rand_pos  = rand(0, $rand_max);
   $rand_key[] = $key_chars{$rand_pos};
}

$rand_pass = implode('', $rand_key);

echo $rand_pass;

?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users