search

Home  >  Q&A  >  body text

codeigniter - ci i18n I found a packaged file on github, but it seems to conflict with the form_validation function. Please take a look.

https://github.com/lawrence08...

Because I think this is more convenient and understandable, I wanted to use this, but there was a problem when it came to verification, so I used the login interface

 public function login() {
        //print_r($_POST);
        $this->form_validation->set_rules('username', '用户名', 'required');
        $this->form_validation->set_rules('password', '密码', 'required');
        if ($this->form_validation->run()) {
            $username = $this->input->post('username');
            $password = $this->input->post('password');
            $data['username'] = $username;
            $data['password'] = $password;


            $user = $this->i2active_user->get_user_by_name($username);

            if ($user) {
                if ($password == $user->password) {
                    $this->session->set_userdata('username', $user->name);
                    redirect('user_list');
                } else {
                    $this->data['login_error'] = '用户名密码错误';
                }
            } else {
                $this->data['login_error'] = '用户不存在';
            }
        }
        $this->load->view('login', $this->data);
    }
    
    
    

Remove the $this->form_validation->run() section and there will be no problem
Why is this
Can you recommend what kind of internationalization you use, thank you

某草草某草草2738 days ago543

reply all(1)I'll reply

  • 漂亮男人

    漂亮男人2017-05-16 16:45:29

    You can take a look at the official multi-language package
    https://github.com/bcit-ci/co...

    reply
    0
  • Cancelreply