database Name : contact
View file name : contact
Mode.php
public function insertdata($data)
{
$data= array
(
'name'=>$this->input->post('name'),
'email'=>$this->input->post('email'),
'subject'=>$this->input->post('subject'),
'message'=>$this->input->post('message'),
);
$datas = $this->db->insert('contact',$data);
}
Controller.php
public function contact()
{
if($this->input->post('submit') == 'Send' ){
$data= array(
'name'=>$this->input->post('name'),
'email'=>$this->input->post('email'),
'subject'=>$this->input->post('subject'),
'message'=>$this->input->post('message')
);
$data = $this->home_model->insertdata($data);
}
$data['menu'] = $this->admin_model->get_menu();
$this->load->view('frontuser/contact',$data);
}
View file name : contact
Mode.php
public function insertdata($data)
{
$data= array
(
'name'=>$this->input->post('name'),
'email'=>$this->input->post('email'),
'subject'=>$this->input->post('subject'),
'message'=>$this->input->post('message'),
);
$datas = $this->db->insert('contact',$data);
}
Controller.php
public function contact()
{
if($this->input->post('submit') == 'Send' ){
$data= array(
'name'=>$this->input->post('name'),
'email'=>$this->input->post('email'),
'subject'=>$this->input->post('subject'),
'message'=>$this->input->post('message')
);
$data = $this->home_model->insertdata($data);
}
$data['menu'] = $this->admin_model->get_menu();
$this->load->view('frontuser/contact',$data);
}
0 comments:
Post a Comment
Thanks