こんにちは私は何を私のコードで間違っているのか把握しようとしている、フォームの検証は常にfalseを返します。 は、ここに私のコントローラからのコードスニペットです:なぜ私のForm_validationは常にFALSEを返しますか?
function edit()
{
//load form_validation class
$this->load->library('form_validation');
//set validation rules
$this->form_validation->set_rules('username','Username','required|trim|xss_clean');
$this->form_validation->set_rules('password_old','password lama','required|trim|xss_clean');
$this->form_validation->set_rules('password_new1','password baru','required|trim|xss_clean');
$this->form_validation->set_rules('password_new2','confirm password','required|trim|xss_clean|matches[password_new1]');
if ($this->form_validation->run() == FALSE)
{
$this->session->set_flashdata('flash_data', 'Lengkapi Form Dengan Benar dan Lengkap');
redirect('admin/akun');
}
else
{
$this->load->model("user_model","user");
if($_POST)
{
$result = $this->user->edit_user($_POST);
if($result == FALSE)
{
$data['page'] = $this->config->item('ci_my_admin_template_dir_admin') . "error_message";
$this->load->view($this->_container, $data);
}
else
{
$this->session->set_flashdata('flash_data', 'Silahkan Log In dengan Username dan Password yang baru!');
redirect('admin/logout');
}
}
}
}
私はそれが動作するために変更する必要があり、他の構成があるの?私の検証ルール内
私は最初は 'else'エコーvalidation_errors('追加した後、適切に – Kunal
フィールドのfalse.So、クロスチェックの名前を返す理由です、ビュー内および検証ルールの入力フィールドの名前が一致しないと思います) ; exit(); 'をチェックしてください。 –
ビューを追加してください。 –