<?php
echo '<script type="text/javascript">',
'function copyTo(input) {',
'input.select();',
'document.execCommand("copy");',
'}',
'</script>'
;
function randomPassword($len = 10){
$length=$len-5;
$conso=array('b','c','d','f','g','h','j','k','l','m','n','p','r','s','t','v','w','x','y','z');
$vocal=array('a','e','i','o','u');
$punct=array('!','!','!');
$password='';
srand ((double)microtime()*1000000);
$max = $length/2;
for($i=1; $i<=$max; $i++){
$password.=$conso[rand(0,19)];
$password.=$vocal[rand(0,4)];
}
$password.=$conso[rand(0,19)];
$password.=rand(1000,9999);
$password.=$punct[rand(0,2)];
$newpass = ucfirst($password);
return $newpass;
}
echo "<div class='kbe_widget kbe-widget widget'><h2 class='widget-title'>Password Generator</h2>";
echo "<table style='border:0px'>" ;
for ($i = 0; $i < 4; $i++)
echo "<tr><th style='border:0px'><input type='text' style='font-weight:normal; font-size:15px; background:#fff; border:0px' value=" . randomPassword() . " onclick='copyTo(this)'></th></tr>" ;
echo "</table><br />" ;