Welcome Guest, Not a member yet? Register   Sign In
How to include footer and header in error/html/error_404.php
#1

I can print the base url at  error/html/error_404.php  by adding following code:-

<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<?php
$ci = new CI_Controller();
$ci =& get_instance();
$ci->load->helper('url');
?>


But couldn't include my header and footer (Located at: [b]views/include/footer.php) in error/html/error_404.php[/b]
Reply
#2

You can use : include_once 'header.php'
Reply
#3

I could be wrong here, but I think the error pages are supposed to be, pretty much, completely stand alone pages, so that they do not rely on your normal header and footer code, avoiding possible loops in case the error is actually caused by something in your footer or header. I usually add a hardcoded link back to the home page, as well as the standard header and message, but nothing more.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB