Welcome Guest, Not a member yet? Register   Sign In
Routing problem on Live server
#7

(09-15-2017, 11:26 AM)ciadvantage Wrote:
Code:
<?

class Pages extends My_Controller{
  //...may need __constructor()
  function view(){
     $this->load->view('yourview');
  }//end view()
} //end class

//Assume yourview.php is under application/views/yourview.php
// then your route is like this in routes.php
...
$route['default_controller']='pages/view'
Then it should show on your default landing site with content of yourview.php

Thank you for the input, i tried to add the constructor like you said, check below, but still though the login in page is displayed as the fist page but submit button wont submit upon giving my login in details

class Pages extends MY_Controller
{

public function __construct()
    {
        parent::__construct();

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

              
    }
    public function index($page = 'login')
    {
        if (!file_exists(APPPATH.'views/'.$page.'.php'))
        {
            // Whoops, we don't have a page for that!
           
            show_404();
        }

        $data['title'] = ucfirst($page); // Capitalize the first letter

f($page == 'dashboard') {
            $this->load->model('model_student');
            $this->load->model('model_teacher');
            $this->load->model('model_classes');
            $this->load->model('model_marksheet');
          

            $data['countTotalStudent'] = $this->model_student->countTotalStudent();
            $data['countTotalTeacher'] = $this->model_teacher->countTotalTeacher();
            $data['countTotalClasses'] = $this->model_classes->countTotalClass();
            $data['countTotalMarksheet'] = $this->model_marksheet->countTotalMarksheet();
}

 if($page == 'login') {
           if($this->session->userdata('logged_in') === true) {
            redirect('../dashboard');
        }
            $this->load->view($page, $data);
        }
}
}
Code:
...
$route['default_controller']='pages'
 and i have a view page called login.php in the application/views folder  which is displayed fine but it wont submit and redirect to the next page which is the dashboard.php which is also present in the  application/views folder but it routes and redirects just fine on my local server
Reply


Messages In This Thread
Routing problem on Live server - by Duk - 09-13-2017, 07:24 AM
RE: Routing problem on Live server - by InsiteFX - 09-13-2017, 08:24 AM
RE: Routing problem on Live server - by Duk - 09-14-2017, 05:24 AM
RE: Routing problem on Live server - by InsiteFX - 09-14-2017, 08:40 AM
RE: Routing problem on Live server - by Duk - 09-14-2017, 11:59 PM
RE: Routing problem on Live server - by Duk - 09-19-2017, 01:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB