Your Ad Here

Home » PHP Code »

0

<?php
echo password_generate(6,6);

function password_generate($min=6,$max=6){

/*has a default minimum value of 6  and maximum value of 6*/

$password=”";

// this variable is for to save 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 $i–;

}
return $password;

// returns the generated password
}

?>

It displays the random password feild with using the php code.

Hope this will be useful.



You may like these posts

    How to convert feeds to html using javascript and phpObject oriented programming in phpHow to calculate statistics in daily, weekly , monthly and yearly using phpHow to request a cross domain ajax with in the js file

 

Leave a Reply