par
Shim » 14 oct. 2010, 19:54
Pourquoi ca marche pas ?
<?php
$alphabet = "abcdefghjkmnopqrstuvwxyz";
$alphabet .="ABCDEFGHJKLMNOPQRSTUVWXYZ";
$alphabet .="123456789";
$nbcar = 11; $i = 0;$motdepasse = "";
srand((double)microtime()*1000000);
while ($i<$nbcar)
{
$valcar = rand(0, strlen($alphabet) );
$motdepasse .= substr("$alphabet",$valcar,1);
$si++;
}
?>
Boucle censée généré un mot de passe.
Pourquoi ca marche pas ?
<?php
$alphabet = "abcdefghjkmnopqrstuvwxyz";
$alphabet .="ABCDEFGHJKLMNOPQRSTUVWXYZ";
$alphabet .="123456789";
$nbcar = 11; $i = 0;$motdepasse = "";
srand((double)microtime()*1000000);
while ($i<$nbcar)
{
$valcar = rand(0, strlen($alphabet) );
$motdepasse .= substr("$alphabet",$valcar,1);
$si++;
}
?>
Boucle censée généré un mot de passe.