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

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'); ?>
$ci = new CI_Controller();
$ci =& get_instance();

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

You can use : include_once 'header.php'

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.

Theme © iAndrew 2016 - Forum software by © MyBB