Hi visitors here i will explain how we can create random password using simple php script.
function Random_Password($length) {
srand(date("s"));
$possible_charactors = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$string = "";
while(strlen($string)< $length) {
$string .= substr($possible_charactors, rand()%(strlen($possible_charactors)),1);
}
return($string);
}
echo Random_Password(8);
makes a password on 8 chars
examples:
include(“genpassword.function”)
Another example a good Pronounceable Password Generator can be done like this
function genpassword($length){
srand((double)microtime()*1000000);
$vowels = array("a", "e", "i", "o", "u");
$cons = array("b", "c", "d", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "u", "v", "w", "tr",
"cr", "br", "fr", "th", "dr", "ch", "ph", "wr", "st", "sp", "sw", "pr", "sl", "cl");
$num_vowels = count($vowels);
$num_cons = count($cons);
for($i = 0; $i < $length; $i++){
$password .= $cons[rand(0, $num_cons - 1)] . $vowels[rand(0, $num_vowels - 1)];
}
return substr($password, 0, $length);
}
echo genpassword(10);
makes a password on 10 chars
Incoming search terms:
- php genPassword (7)
- how to create random password in php (6)
- How to create passwords in php (5)
- zend random password (5)
- how to create ul li using menu (4)
- createrandome passwords using php (2)
- php script for generate random password (2)
- charkeycode javascript tutorial (2)
- php genpass (1)
- zend random string (1)
- php generating random password for login page example (1)
- php generate random password (1)
- php script for random string online (1)
- php script random password (1)
- php script that generate passwords automaticall (1)
- php shuffle function custom array microtime (1)
- php zend random password (1)
- random password zend (1)
- random password php zend (1)
- random generated password using jquery (1)
- random function to generate password in java (1)
- To create random password in PHP (1)
- ramdom password php (1)
- vowels random string php (1)
- php zend random string (1)
- php generate dates random (1)
- php function to create pronounceable passwords (1)
- how to create random string using php (1)
- how to create generate random password with php (1)
- generate random password javascript (1)
- generate pronounceable passwords perl (1)
- generate passwords PHP (1)
- create random password php tutorial (1)
- create random password in php based on date (1)
- create password by random in javascript with validation (1)
- how to generate random password in php (1)
- how to generate random passwords in zend (1)
- how to send random password to email in php (1)
- php create random password (1)
- php create a set of random passwords (1)
You will also be interested in ,
- Display Tags in wordpress
- Appending string using php to a text file
- Displaying or changing images each day
- Windows XP shortcuts for interner explorer, excel and powepoint
- How to install XAMPP
- Arrays In PHP
- Hit counter using php
- Caching of web page using php
- MD5 Function and Unique ID in php
- Email address validation using php
