I must admit what you are doing send shivers down my timbers,
Are you using a htaccess file? if so remove it lets keep things simple add it later if you get things working
what is your system/application/config/config.php base_url and index_page set to?
check your system/application/config/routes.php what is your default_controller set to
what I think you are trying to do is use 1 controller for multiple views… so this is how I would do it:
1:first I would check my system/application/config/config.php
..
// obviously this may differ on your set up
$config['base_url'] = 'http://localhost/CodeIgniter/';
..
$config['index_page'] = "index.php";
2:then check my default controller in system/application/config/routes.php
$route['default_controller'] = "home";
3:Then create a home controller in the controllers directory called home.php (note file names and class names are case sensitive lowercase for file names capital letter for class names)
controllers/home.php
<?php
class Home extends Controller {
function Home(){
parent::Controller();
}
function index() {
$this->load->view('start');
}
// note if paramter not passed in its set to default view
function loadview($view='view')
{
$this->load->view('header');
$this->load->view("view/".$view);
$this->load->view('footer');
}
}
?>
4: Then you should be able to link to it as follows in the view called start
note I use site url to get the full url (my site_url() will produce “http://localhost/CodeIgniter/index.php”)
views/start.php
<a href="http://<?=site_url?>/home/loadview/testview">Link</a>
5:you can then create a testview in your view directory
views/testview.php
6:not forgetting to create the header and footer view 😊.
view/header.php
view/footer.php
7:when you browse to http://localhost/CodeIgniter/ the view with the link should appear (your url may of course differ)
*note to access the loadview method in the home controller directly the url will look somthing like:
http://localhost/CodeIgniter/index.php/home/loadview/