Help with captcha validation [SOLVED]

edited July 2012 in Modules
Hello,
I have a form with captcha.

I am trying to validate it like this:
$this->validator->add_rule('captcha', 'callback_check_captcha', 'captcha');
In my contorller I have this function:
function _valid_captcha() { $valid = TRUE; // check captcha if (!$this->input->post('captcha') OR strtoupper($this->input->post('captcha')) != strtoupper($this->session->userdata('comment_captcha'))) $valid = FALSE; return $valid; }
I get the error:
Message: call_user_func_array() expects parameter 1 to be a valid callback, function 'callback_valid_captcha' not found or invalid function name

Filename: libraries/Validator.php

Line Number: 392

How do I call callback functions with the validator?

Comments

Sign In or Register to comment.