I am trying to submit my form using post method in codingniter , and my form is called from the main view when i submit the form i get 404 Page is not found .
This is my header form :
<form class="form-horizontal" id="sendform" role="form" action="<?php echo `base_url('/pages/insert_into_db') ;?>" method="post" >`
and in the controller i have this function controller :
pages.php :
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Pages extends CI_Controller {
public function view ($page='gurantee'){
if ( ! file_exists(APPPATH.'views/pages/'.$page.'.php'))
{
// Whoops, we don't have a page for that!
show_404();
}
$this->load->view('pages/'.$page);
}
public function index ()
{
$this->load->helper('url');
$this->load->view('Welome');
}
public function display () {
$this->load->model('ektreemodel');
$data['query']=$this->ektreemodel->display();
$this->load->view('table',$data);
}
public function insert_to_db()
{
$this->load->helper('url');
$this->load->model('ektreemodel');
$this->ektreemodel->insert_into_db();
$this->load->view('gurantee');
}
public function dis () {
$this->load->helper('url');
$this->load->view('registration');
}
}
and the url is :
http://localhost:8888/index.php/pages/index.php/pages/display
it was working fine when i submit my form the main first view , is there something i have to change or , is there some way i can use javascript , so when i will use post method it will call display function from the controller ?