Quote:
Originally Posted by NullPointer
The error message means that the generatePassword() method does not exist in the forgotpass class. The syntax of the code you posted is correct, but the method does not exist.
|
Thanks NullPointer,
Please let me know if this is correct method:
function generatePassword ($length = 8)
{
$password = "";
$possible = "0123456789bcdfghjkmnpqrstvwxyz";
$i = 0;
while ($i < $length) {
$char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
if (!strstr($password, $char)) {
$password .= $char;
$i++;
}
}
return $password;
}
|