Free web development scripts for the webmasterDevelopment Scripts

 Site Navigation
 o Development Scripts
 o Text Only Edition
 o PHP.net News
 o Tutorials
 o Register an account
 o New entries this week
 o Affiliates/Links
 o Contact Us
 o About us
 o Advanced Search

 Browse Path
 o 6 users online
 o Most users online: 67
 o Home
  o PHP
   o Random
    o Script

 Member Login
User Name
Password

 Standards
Valid XHTML 1.0!
Valid 
CSS!

 Recommended Links
 o PHP Freaks
 o Designer Baby Clothes
 o Advertise Here Make Money
 o Open Source Design
 o devnet
 o Wedding Vendor Directory
 o Free Wedding Websites
 o OxyScripts
 o designplace

Random Password Generator (Rated 0)

Description:

This will create a random password, particularly useful for 'lost password' functionality.

Code starts here


<?PHP

function makeRandomPassword() {
$salt = "abchefghjkmnpqrstuvwxyz0123456789";
srand((double)microtime()*1000000);
$i = 0;
$pass = '' ;
while (
$i <= 7) {
$num = rand() % 33;
$tmp = substr($salt, $num, 1);
$pass = $pass . $tmp;
$i++;
}
return
$pass;
}
$random_password = makeRandomPassword();
echo
"Random Password is $random_password";

?>


Submitted by Devscripts on 24-03-2003 16:58


Rate This Script

User Contributed Comments

Registered Members login
© Copyright 2003 - Devscripts.net