Callback function in Codeigniter with multiple parameters during form validation

前端 未结 3 882
北荒
北荒 2020-12-21 04:15

In Codeigniter:

Here is the callback function that I am using for validation:

public function has_match($password, $username){
    if (0) {
        /         


        
3条回答
  •  臣服心动
    2020-12-21 04:56

    // 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;
    
            }  
        }
    

提交回复
热议问题