Passwords
|
|
|
|
/*********************************************
***** Author Santosh
***** email santos_raj@yahoo.com,
santos_raj@rediffmail.com,
santosh_kumarsingh@hotmail.com
***** just copy the code and paste. Save this
***** as a php file. run the url at the browser
***** and that is all.
**********************************************/
<?php
$min=4;// minimum length of password $max=15;// maximum length of password $pwd=""; //to store generated password for($i=0;$i<rand($min,$max);$i++){
$num=rand(48,122);
if(($num > 97 && $num < 122)){
$pwd.=chr($num);
}else if(($num > 65 && $num < 90)){
$pwd.=chr($num);
}else if(($num >48 && $num < 57)){
$pwd.=chr($num);
}else if($num==95){
$pwd.=chr($num);
}else{
$i--;
}
}
echo $pwd;// prints the password ?>
|
|
|
Usage Example
|
|
|
Rate This Script
|
|
|
|