WE ARE FAMILY
Would you like to react to this message? Create an account in a few clicks or log in to continue.

PHP Code for Random Password

Go down

PHP Code for Random Password Empty PHP Code for Random Password

Post  hira Mon Sep 08, 2008 12:26 am

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

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum