Welcome Guest, Not a member yet? Register   Sign In
Page Not Found....Anybody have the right Solution
#1

[eluser]Nidheesh[/eluser]
The page i requested was there and the other controllers are works fine....What's the problem...Is there any permanent solution

My Controller Code


Code:
<?
class Testimonials extends CI_Controller {
    function __construct()
    {
        parent::__construct();
        $this->load->model('testimonials_model', "", TRUE);
        
    }

   function Testimonials()
    {
        
      // $this->load->model('testimonials_model');
       $this->data['Page_Info']=$this->testimonials_model->get_menus();
       $this->load->view('testimonials.php', $this->data);
      //$this->load->view('Testimonials.php');
       echo  $this->data['Page_Info'];
      
       //print_r($this->data) ;
    }
}
?>

My Model Code

Code:
<?
class Testimonials_model extends CI_Model{
    public $id;
    public $menuname='';
    public $menulink='';
    
    function Testimonials()
    {
       parent::__construct();
    //   $this->load->database();    
    }
    
     function get_menus()
     {
        $this->db->select('*');
        $this->db->from('tbl_menus');
        $Page_Info=$this->db->get()->result();
        return $Page_Info;
        echo $Page_Info;
     }
}
?>


Error

Code:
http://localhost/samplesite/index.php/Testimonials


[code]
404 Page Not Found

The page you requested was not found.
[/code
#2

[eluser]Eduard Stankovic[/eluser]
change controller code to:

Code:
<?
class Testimonials extends CI_Controller {
    function __construct()
    {
         ....
        
    }

   function index()
    {
      .....
    }
}
?>


404 appears because you have 2 constructors and no index function which is called automaticaly when second parameter is not provided

more info here: http://ellislab.com/codeigniter/user-gui...llers.html
#3

[eluser]Nidheesh[/eluser]
Ya got it thanks a lot.....Now its works




Theme © iAndrew 2016 - Forum software by © MyBB