[eluser]beatryder[/eluser]
[quote author="flumps" date="1187231443"]ok it looks like im finally getting some where with the thanks you guys been real stars :d
one small problem one big step for me now though...
next problem is php includes...
any ideas how to include a .php file correctly using it... as my friend has setup
Code:
<?php include("header.php"); ?>
at the top of every page and the same for footer but it seems to be eorring only with that now I get the following error....
Warning: include(header.php) [function.include]: failed to open stream: Operation not permitted in /home/user/domains/domain/public_html/system/application/views/index_view.php on line 1
Warning: include() [function.include]: Failed opening 'header.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/user/domains/domain/public_html/system/application/views/index_view.php on line 1
same for the footer include....
think this has somthing to do with the way php5 is setup correct?[/quote]
no, in fact it has to do with how CI uses PHP files. See when CI loads a view, the includes are relative to the root (where the index.php) file is.
just replace
Code:
<?php include("header.php"); ?>
with
Then in your controller add a line like this:
Code:
$data['header'] = $this->load->view('header',TRUE);
//... some other code maybe?
$this->load->view('index_view',$data);
BTW, adding the "TRUE" parameter makes CI return the contents of the view rather than displaying it.
I hope I was clear enough for you.