0
Hello wanted to know how to put a function of random "passwords" inside the input, the code generate random password is this:
function geraSenha($tamanho = 8, $maiusculas = true, $numeros = true, $simbolos = false)
{
$lmin = 'abcdefghijklmnopqrstuvwxyz';
$lmai = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$num = '1234567890';
$simb = '!@#$%*-';
$retorno = '';
$caracteres = '';
$caracteres .= $lmin;
if ($maiusculas) $caracteres .= $lmai;
if ($numeros) $caracteres .= $num;
if ($simbolos) $caracteres .= $simb;
$len = strlen($caracteres);
for ($n = 1; $n <= $tamanho; $n++) {
$rand = mt_rand(1, $len);
$retorno .= $caracteres[$rand-1];
}
return $retorno;
}
?>
The input code is this
<input name='AwardID' id='AwardID' type='text' value="Senha aleatoria" maxlength='40' value='' />
And how do you block input so you can’t write? I thank anyone who can help me right now.
Don’t load that part when I do it like this: http://prntscr.com/diglvl
– user39571
Sorry, take the word Function after echo
– Bruno Henri
Thanks friend help me a lot, a question, has to create a button that when you press generates another password and so on?
– user39571