Jme
19-02-2008, 10:31 PM
Having some trouble generating the random pass, Anyone have any ideas?
<?php
function random_pass($length)
{
$chars = "abcdefghijkmnopqrstuvwxyz1234567890";
$pass = "";
$charlength = strlen($chars);
$randchar = rand()%($charlength);
while(0<$length)
{
$pass = substr($chars, $randchar, 1);
}
return($pass);
}
$password = random_pass(7);
echo("" . $password . "");
?>
That's just a prototype to test the function.
It's basically meant to loop through until there are 7 characters in the pass string but it keeps giving the error:
Fatal error: Maximum execution time of 30 seconds exceeded in /home/jclabz/public_html/pass.php on line 10
and
Fatal error: Maximum execution time of 30 seconds exceeded in /home/jclabz/public_html/pass.php on line 8
Been trying to debug it for about an hour starting to annoy me alot now.
<?php
function random_pass($length)
{
$chars = "abcdefghijkmnopqrstuvwxyz1234567890";
$pass = "";
$charlength = strlen($chars);
$randchar = rand()%($charlength);
while(0<$length)
{
$pass = substr($chars, $randchar, 1);
}
return($pass);
}
$password = random_pass(7);
echo("" . $password . "");
?>
That's just a prototype to test the function.
It's basically meant to loop through until there are 7 characters in the pass string but it keeps giving the error:
Fatal error: Maximum execution time of 30 seconds exceeded in /home/jclabz/public_html/pass.php on line 10
and
Fatal error: Maximum execution time of 30 seconds exceeded in /home/jclabz/public_html/pass.php on line 8
Been trying to debug it for about an hour starting to annoy me alot now.