I am just inserting data in codeigniter controller part at pastebin http://pastebin.com/KBtqrAkZ
public function add_product()
{
$this->lang->load('log_in', 'english');
log_in_check($this->lang->line('log_in_authentication_error'), 'admin/log_in');
$this->lang->load('common', 'english');
$data['title'] = $this->lang->line('admin_index_title');
$this->load->view('admin_template/header', $data);
$this->load->view('admin_template/left_menu');
$data['error_msg'] = '';
if ($this->form_validation->run('add_product') === TRUE)
{
$this->admin_model->add_product($this->input->post());
$this->session->set_flashdata('status_msg', $this->lang->line('add_product_success'));
redirect(uri_string(), 'refresh');
exit ;
$data['error_msg'] = $this->lang->line('add_product_invalid_data');
}
$this->load->view('admin/add_product');
//$this->load->view('admin_template/notification');
$this->load->view('admin_template/footer');
}
Than my model part is simple add at pastebin http://pastebin.com/WiLHV2sr
public function add_product($data = array())
{
$this->db->insert('ishop_product', $data);
return $this->db->insert_id();
}
my problem is after redirecting if I press ctrl + F5 or F5 than the data is inserting. I am a new in codeigniter. Help me please. Any help will be greatly appreciated.