In Codeigniter:
Here is the callback function that I am using for validation:
public function has_match($password, $username){
if (0) {
/
// CALLBACKS
public function check_user(){
$result = FALSE;
$username=$this->input->post('username');
$email=$this->input->post('emailad');
$dbmember=$this->members->get_members();
foreach ( $dbmember as $key){
// condition of username and email
if($username==$key && $email==$key){
if($username == $key->UserName && $email == $key->EmailAddress){
$this->form_validation->set_message('check_user','already existed!
Please check username and email agian.');
return FALSE;
break;
}
return TRUE;
}
}