0

I'm making practice with CakePHP user registration validation but I get some error from the core:

Warning (2): preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash [CORE/cake/libs/model/model.php, line 2611]

This is the validation array:

var $validate = array (
    'username' => array (
        'ruleUser1'=> array (
            'rule' => 'alphaNumberic',
            'message' => 'The username must be alphanumeric only'
        ),
        'ruleUser2' => array (
            'rule' => 'notEmpty',
            'message' => 'Username can\'t be empty'
        ),
        'ruleUser3' => array (
            'rule' => 'isUnique',
            'message' => 'This username has already been taken.'
        )
    ),
    'password' => array (
        'rulePass1'=> array (
            'rule' => array ('minLength', 8),
            'message' => 'Password must be 8 character length'
        ),
        'rulePass2' => array (
            'rule' => 'notEmpty',
            'message' => 'Password can\'t be empty'
        )
    )
);

Where I'm wrong?

1
  • Try removing fields/rules to find out which field/rule is generating error. Commented Mar 29, 2011 at 19:51

1 Answer 1

1
'username' => array (
    'ruleUser1'=> array (
        'rule' => 'alphaNumberic',
        'message' => 'The username must be alphanumeric only'
    ),

alphaNumberic should be alphaNumeric. I think that is the source of the problem?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.