FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Randomizing password..





Diablosblizz
Hey, I was wondering if anybody had a php script that would randomize a couple of letters and numbers to get a password. For example:

There could be a Dropdown box that says How many Letters: 1-10?

Then once they click generate it generates a password and displays it in a text box.

Anybody got this, I tried google and got nothing.

Thanks.
hexkid
Code:
function gen_pwd($len) {
  $pwd = '';
  while ($len--) {
    $pwd .= chr(rand(0, 25) + 97);
  }
  return $pwd;
}
Diablosblizz
What is this supposed to do? I put it in <?php and ?>...
hexkid
Diablosblizz wrote:
What is this supposed to do? I put it in <?php and ?>...


Code:
<?php
function gen_pwd($len) {
  $pwd = '';
  while ($len--) {
    $pwd .= chr(rand(0, 25) + 97);
  }
  return $pwd;
}

echo 'Your password is: "<b><tt>', gen_pwd(10), '</tt></b>" (without the quotes).<br>';
?>
Diablosblizz
Thank you.
Related topics
htaccess Password Protection
password problem
Does Frihost's SMTP server require login and password?
HELP! I registered, but never got my confirmation email.
Why are no admins helping me?
Password Protecting Directories?
Daddy's Password
how can i change password in my database?
How to bypass your BIOS Password
Need New Password for account
Cant change my password
winrar password
password coding help
Account created, but directadmin password not received
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.