PHP Code for Random Password
WE ARE FAMILY :: IT World :: Programming
Page 1 of 1
PHP Code for Random Password
Google "PHP Random Password Generation." You'll get lots of useful results
Here is a one possibility:
//list of possible password characters
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX YZ0123456789!@#$%^*_-+=?|:";
//length of the password to be generated
$length = 8;
//generate the password
for($i = 0; $i<$length; $i++) {
$Rand = rand(0, strlen($chars)-1);
$pwd .= substr($chars, $Rand, 1);
}
Here is a one possibility:
//list of possible password characters
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX YZ0123456789!@#$%^*_-+=?|:";
//length of the password to be generated
$length = 8;
//generate the password
for($i = 0; $i<$length; $i++) {
$Rand = rand(0, strlen($chars)-1);
$pwd .= substr($chars, $Rand, 1);
}
hira- Posts : 4
Join date : 2008-09-07
WE ARE FAMILY :: IT World :: Programming
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|