note 40252 added to function.setcookie

From: Date: Thu, 26 Feb 2004 16:50:01 +0000
Subject: note 40252 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-65815@lists.php.net to get a copy of this message
For those of you who wish to have their user's use a more complicated password, this regular expression makes sure they use at least one number, one lowercase letter, and one uppercase letter. This may be inconvenient for your users, but it will provide a secure ground for md5 hash. <?php $string = "banana"; if (!preg_match('/^\w*(?=\w*\d)(?=\w*[a-z])(?=\w*[A-Z])\w*$/', $string)) { echo "That is not a valid password."; } else { echo "That is a valid password."; } ?> Enjoy. ---- Manual Page -- http://www.php.net/manual/en/function.setcookie.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+40252 Delete -- http://master.php.net/manage/user-notes.php?action=delete+40252&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+40252&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#65815) next »