hello

besoin d'aide: se programme (php) génère 32 caractéres, mais pour mon utilisation il doit en générer que 7. qu'est que je dois modifier ?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 
<html>
<head>
<title>Login</title>
</head>
 
<body>
<br>
<br>
<center>
<?
function id() {
    srand(time());
    $a="abcdefghijklmnopqrstuvwxyz0123456789";
     for($i; $i<=16; $i++) {
         $id.=substr($a, (rand()%(strlen($a))),2);
     }
    return(md5($id));
}
if (!empty($id)) {
    echo "Login : $id<br>\n";
}
$id=ID();
 
print ("<form method=post action=\"gener.php3?id=$id\">");
print ("<input type=submit value=\"Générer un nouvel login\">");
print ("</a></form>");
 
?>
</center>
 
</body>
</html>
merci