is_signed_in()) { $errors = array(); $user_pass = ""; if (empty($_POST['user_pass'])) { $errors[] = "You must provide a password."; } else { $user_pass = $_POST['user_pass']; $pass_check = $_POST['user_pass_check']; if (preg_match("/^[a-zA-Z0-9\W]*$/", $user_pass) === false) { $errors[] = "Password contains invalid characters!"; } if ($user_pass !== $pass_check) { $errors[] = "The two passwords do not match."; } } if (!empty($errors)) { echo 'Please check the following problems: