• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom 404

#1
[eluser]Zulkifli Said[/eluser]
hi, i try to use custom 404 page from this tutorial http://maestric.com/doc/php/codeigniter_404

my controller error.php

Code:
class Error extends Controller{

function error_404()
{
  $CI =& get_instance();
                $CI->output->set_status_header('404');
  echo "error bro";

}
}

when i open link localhost/mading/admin/blablabla , where there is not function blablabla() in controoler admin. the output : "error bro"


i try change line in method error_404() become the code below,

Code:
class Error extends Controller{

function error_404()
{
  
  $CI =& get_instance();
  $CI->output->set_status_header('404');
  $data['title'] = "404 Page Not Found";
  $data['body'] = $CI->load->view('web/404','',true);
  $CI->load->view('web/web_page',$data);
}
}

but, when i open link localhost/mading/admin/blablabla , where there is not function blablabla in controller admin. the output : blank page. the function error_404 not load the view . why the 404 page not load when i open controller admin/blablabla ??


thanks


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.