我正在使用form_validation库来验证我的表单。
一切都运转良好,但在成功完成后,它向我展示了我填写的所有价值观。我正在使用ci v3。我不想做一些重定向。
if ($this->form_validation->run() == True){
//saving values to db
$this->session->set_flashdata('registration_success', '<h4 class="alert alert-success">Registration successful.. Please check your email.</h4>');
$this->_field_data = array();
//$this->auth();
}
答案 0 :(得分:0)
成功验证后,您可以刷新页面,以便旧值不会显示如下:
public function yourSaveFunction(){
if ($this->form_validation->run() == True){
//saving values to db
$this->session->set_flashdata('registration_success', '<h4 class="alert alert-success">Registration successful.. Please check your email.</h4>');
$this->_field_data = array();
//$this->auth();
redirect('{your_current_controller_name/your_page_load_view}');
}
}