Welcome Guest, Not a member yet? Register   Sign In
A PHP Error was encountered: libraries/Loader.php(673) : eval()'d code --require_once(header.php)
#1

[eluser]cafesuada[/eluser]
Hey guys. I have gotten this error for many days please help.
Code:
A PHP Error was encountered

Severity: Warning

Message: require_once(header.php) [function.require-once]: failed to open stream: No such file or directory

Filename: libraries/Loader.php(673) : eval()'d code

Line Number: 29
And here code:
Code:
...

<body>    
<?php
// Show all errors
error_reporting(E_ALL);

// Commom variables
$segment = $this->uri->segment(1);
$base_url = base_url();
        
?>              
<div id="container">    
    &lt;!-- BEGIN HEADER --&gt;
    &lt;?php require_once("header.php");?&gt;
    &lt;!-- END HEADER --&gt;
    &lt;!-- BEGIN MIDDLE --&gt;
     <div id="middle">
        &lt;!-- BEIGN LEFT --&gt;
        &lt;?php require_once("left.php");?&gt;
        &lt;!-- END LEFT --&gt;
        &lt;!-- BEGIN MAIN --&gt;
        &lt;?php require_once $layout;?&gt;
        &lt;!-- END MAIN --&gt;
        &lt;!-- BEGIN RIGHT --&gt;
         &lt;?php require_once('right.php');?&gt;
        &lt;!-- END RIGHT --&gt;
    </div>    
    &lt;!-- END MIDDLE --&gt;
    &lt;!-- BEGIN FOOTER --&gt;
    &lt;?php require_once('footer.php');?&gt;
    &lt;!-- END FOOTER --&gt;
</div>
&lt;/body&gt;
&lt;/html&gt;
I have used this way for another project but didn't get that error..

please show me how to fix this..

all paths right.

Thanks all:

My information:
php: 5.3.1
CI: 1.7.2
#2

[eluser]Mat-Moo[/eluser]
I'm guessing that this is a "View"? file? And that header.php is also in the "View" folder? If so that't the problem. You should be loading the header with $this->load->view('header'); or change the include with the full path to the header file.
#3

[eluser]cafesuada[/eluser]
Thanks for suggestion. It was fixed but in unwanted way. I had to renew my project by copy every single code. That was unsatisfied




Theme © iAndrew 2016 - Forum software by © MyBB