Welcome Guest, Not a member yet? Register   Sign In
extending validation

I extended validation library and I make a function
function unique_email($str, $field,$user)
I call that
$rules['email'] = "required||valid_email|unique_email[users.user_email,$username]";
but there is the error
Missing argument 3 for MY_Validation::unique_email()
How can I call this function?

a validation callback function takes only one argument by default and returns true or false. So in your case:
function unique_email($str) {
    // Return true if $str validates
    // Retrun false if it doesn't
$str is the $_POST value for this field

Theme © iAndrew 2016 - Forum software by © MyBB