Hello!
How can i generate a new password?
Actually, i use this code:
function CREATE_PSW($size = 8)
{ # this function generates a character ID
srand((double)microtime()*1000000);
$pool = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$pool .= "abcdefghijklmnopqrstuvwxyz";
$pool .= "0123456789";
for($index = 0; $index < $size; $index++)
{ $id .= substr($pool,(rand(1,100000)%(strlen($pool))),1);
$resultado = rand(1,1000000);
}
return($id);
}
In windows and php 4.0 it works, but in linux and php 4.2 it doesn't do it. Srand always generates the same, 1 or 2.
What's wrong? what can i do?
Thanks!
Router
🙂