PHP forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.
March 2024
SunMonTueWedThuFriSat
     12
3456789
10111213141516
17181920212223
24252627282930
31      

Calendar Calendar

Latest topics
» Kabaddi, Kabaddi, Kabaddi, Kabaddi......PHP?
PHP password generator EmptyFri Jul 22, 2011 1:37 pm by shyamsunder

» Thousands of Free PHP Scripts Recommended
PHP password generator EmptyWed May 18, 2011 10:33 am by bizboy12

» PHP form validation problem?
PHP password generator EmptyWed Jan 12, 2011 1:25 pm by simy202

» string wrap
PHP password generator EmptySat Aug 02, 2008 2:06 pm by scvinodkumar

» retrieving current date rows
PHP password generator EmptyTue Jul 15, 2008 3:25 am by scvinodkumar

» number in words
PHP password generator EmptyTue Apr 29, 2008 3:10 pm by scvinodkumar

» Simple PHP Form Field Generator
PHP password generator EmptyFri Apr 25, 2008 12:28 pm by scvinodkumar

» PHP password generator
PHP password generator EmptyFri Apr 18, 2008 7:24 pm by scvinodkumar

» PHP Script to Extract Email Address from any text
PHP password generator EmptyFri Apr 18, 2008 7:18 pm by scvinodkumar

Search
 
 

Display results as :
 


Rechercher Advanced Search

Affiliates
free forum
 


Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

PHP password generator

Go down

PHP password generator Empty PHP password generator

Post  scvinodkumar Fri Apr 18, 2008 7:24 pm

function generatePassword($length=9, $strength=0) {
$vowels = 'aeuy';
$consonants = 'bdghjmnpqrstvz';
if ($strength & 1) {
$consonants .= 'BDGHJLMNPQRSTVWXZ';
}
if ($strength & 2) {
$vowels .= "AEUY";
}
if ($strength & 4) {
$consonants .= '23456789';
}
if ($strength & Cool {
$consonants .= '@#$%';
}

$password = '';
$alt = time() % 2;
srand(time());
for ($i = 0; $i < $length; $i++) {
if ($alt == 1) {
$password .= $consonants[(rand() % strlen($consonants))];
$alt = 0;
} else {
$password .= $vowels[(rand() % strlen($vowels))];
$alt = 1;
}
}
return $password;
}

scvinodkumar
Admin

Posts : 40
Join date : 2008-01-30

https://solutions.aforumfree.com

Back to top Go down

Back to top

- Similar topics

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