0

I am having some problems with codeigniter, It is only letting me load the index method and not any of the other functions:

My code:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Private_page extends CI_Controller 
{

   function __construct()
   {
      parent::__construct();
      if($this->session->userdata('paramID') === false) {
         redirect('/public');
      }
   }



   public function index()
   {
        /* Header Data */   

        $data = array(
                    'title' => 'Bizispace Private Page',
                    'paramID' => $this->session->userdata('paramID')
                );

        // Load Header
        $this->load->view('template/header.php', $data);

        /* Get Subcriptions Details */

        $this->load->view('private/index.php', $data);
        $this->load->view('template/footer.php');
   }

   public function logout()
   {
        $this->session->sess_destroy();
        redirct('public_page');     
   }
}

?>

I have a route setup:

$route['private'] = "private/private_page";

and then I run: /index.php/private/ it displays the index page fine but if i run /index.php/private/logout I get:

"Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid."

Edit* I am running WAMP on 32 bit windows 7

Am i doing something wrong?

1 Answer 1

9

Add to your routes:

$route['private/(:any)'] = "private/private_page/$1";
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you so much that sorted it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.