du kunne bruge rand og shuffle til at lave et random password
ref
http://php.net/manual/en/function.shuffle.php#95414
<?php
function randPass($upper = 3, $lower = 3, $numeric = 3, $other = 2) {
//we need these vars to create a password string
$passOrder = Array();
$passWord = '';
//generate the contents of the password
for ($i = 0; $i < $upper; $i++) {
$passOrder[] = chr(rand(65, 90));
}
for ($i = 0; $i < $lower; $i++) {
$passOrder[] = chr(rand(97, 122));
}
for ($i = 0; $i < $numeric; $i++) {
$passOrder[] = chr(rand(48, 57));
}
for ($i = 0; $i < $other; $i++) {
$passOrder[] = chr(rand(33, 47));
}
//randomize the order of characters
shuffle($passOrder);
//concatenate into a string
foreach ($passOrder as $char) {
$passWord .= $char;
}
//we're done
return $passWord;
}
?>
brug
<div class="form-group">
<label class="col-md-4 control-label" for="nummer">Password :</label>
<div class="col-md-4">
<input value ="<?php echo randPass();?>" id="clubpassword" name="password" required="required" class="form-control input-md" type="password">
</div>
</div>