PHP Code for Random Password

Post new topic   Reply to topic

View previous topic View next topic Go down

PHP Code for Random Password

Post  hira on Sun Sep 07, 2008 8:26 pm

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);
}

hira

Posts: 4
Join date: 2008-09-07

View user profile

Back to top Go down

View previous topic View next topic Back to top


Post new topic   Reply to topic
Permissions of this forum:
You cannot reply to topics in this forum