this is my controller:-
public function home() {
if($this->session->userdata('id')) {
$this->header();
$this->load->model('admincon');
$e = $this->admincon->select();
$data['e'] = $e;
$this->load->view('admin/home',$data);
} else {
$this->index();
}
}
in the view page of function home()
there is a form which submitted through function subques()
the function is here:-
public function subques() {
if($this->session->userdata('id')) {
$tp=$this->input->post('box1',TRUE);
$s=$this->input->post('box',TRUE);
$t=$this->input->post('t',TRUE);
$a=$this->input->post('a',TRUE);
$b=$this->input->post('b',TRUE);
$c=$this->input->post('c',TRUE);
$d=$this->input->post('d',TRUE);
$n=$this->input->post('n',TRUE);
$this->load->model('admincon');
$this->admincon->subque($s,$t,$a,$b,$c,$d,$n,$tp);
$this->home();
} else {
$this->index();
}
}
but after submitting the values to the database when user redirected to the page if they click on refresh button the previous data store into the database another time. how to solve this problem.
i mean how to clear the variables after use them.