Hello!
I created a form which redirects to protected page upon entering any five digits in password field.
Here's the code at Custom Server Side Validation:
Could you please give any hints to implementing regex check?
I created a form which redirects to protected page upon entering any five digits in password field.
Here's the code at Custom Server Side Validation:
<?php
$data =& $form->data['password'];
$regex = '[0-9]{3}';
if ( isset($data) && $data ) {
if ( preg_match($regex, $data) === 0 ) {
$form->validation_errors['password'] = "Invalid data";
return false;
}
}
?>
Could you please give any hints to implementing regex check?