Handling 404 errors correctly

3 posts by 2 authors in: Forums > CMS Builder
Last Post: May 15, 2013   (RSS)

By gregThomas - May 15, 2013

Hi Greg,

I've done a bit of research, and this method seems to work quite well:

if (!$Record) {
  dieWith404(file_get_contents('error.html'));
}

I had to use the file_get_contents function as opposed to include as the echo in the dieWith404 causes a trailing 1 to appear at the end of the file. 

Let me know if you have any questions.

Cheers!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By gversion - May 15, 2013

Hi Greg,

That's worked great, thank you very much.

Regards,

Greg