Welcome Guest, Not a member yet? Register   Sign In
404 page not found using index as function name in controller
#1

I am new to CI. I am wondering why when I use index as function name, it says page not found. But if change index function name to something else, it display the page. I am trying this on my localhost.

Example code

PHP Code:
class Form extends CI_Controller {


        public function index()
        {
                $this->load->helper(array('form''url'));

                $this->load->library('form_validation');

                if ($this->form_validation->run() == FALSE)
                {
                        $this->load->view('myform');
                }
                else
                {
                        $this->load->view('formsuccess');
                }
        }

Reply


Messages In This Thread
404 page not found using index as function name in controller - by magnus_carlsen - 03-15-2017, 01:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB