Passwords
|
|
|
|
<?
srand((double)microtime()*1000000); $characters = "a,b,c,d,e,f,1,2,3,4,5,A,B,C,D,E,F";
// symbols where are allowed in the password $characters_length = (strlen($characters)-1)/2; $token = explode(",",$characters);
$pass_length=8; // length of the password
for($i=0;$i<$pass_length;$i++) {
$rand = rand(0,$characters_length);
$password.= $token[$rand];
}
echo "$password"; ?>
<?
srand((double)microtime()*1000000); $token = md5(uniqid(rand()));
$password = substr($token, 0, 3); $password .= substr($token, 5, 2); $password .= substr($token, -3);
echo "$password"; ?>
|
|
|
Usage Example
|
|
|
Rate This Script
|
|
|
|