I've got my user registration script up & running but what was wondering how I could restrict the user password creation field to something like "please enter 5 to 8 characters, 3 of which must be numbers and the rest alphabetical" with no other characters such as $, @, etc. Any help would be appreciated.
$pass = $_POST['pass']; $err = ''; $min = 5; $max = 8; if (strlen($pass) < $min) { $err = 'too short'; } else if (strlen($pass) > $max) { $err = 'too long'; } else if (!preg_match('/^([a-z0-9]+)+$/i', $pass)) { $err = 'invalid char'; } PHP: