RE: [PHP] I need a 'good password' validation routine.
| From: | John W. Holmes | Date: | Fri, 11 Apr 2003 00:29:02 +0000 |
| Subject: | RE: [PHP] I need a 'good password' validation routine. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143411@lists.php.net to get a copy of this message | ||
> I'm looking for a simple function or so that will tell a user if they
have
> a "safer" password. Ideally it would check that they used letters &
> numbers, upper/lower case, and mebbe at least one punctuation
character.
> This can be in JavaScript too if you don't have a PHP version. In fact
JS
> is almost preferred since that's how I validate a lot of the other
fields. > Either way. I just want to avoid passwords like "pass1" and
"secret" and
> "daevid"...
Use a PHP method. A javascript method is going to be useless since
you'll have to check it again in PHP because people can disable/work
around javascript.
As for checking the password, just run it against a couple preg_matches
to make sure it has [a-z], [A-Z], [0-9], etc...
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/