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
#2

There's no reason why this would happen. Whatever the problem is, it's not the function name.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB