...

View Full Version : IE Won't display default error page



RyanB88
07-14-2012, 04:39 AM
I have a php script I wrote using IP based authentication. I have code that looks like this:


if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1') {
header("HTTP/1.0 403 Forbidden");
die();
}

The problem is all I get is a blank page if i access it on a remote machine, well on IE atleast. I haven't tried from another browser.

What does it take to get IE to show its default 403 error page? I do not want to create a custom error page, the default browser one will work just fine....if i get get it to show.

On second thought I think I identified the problem, a look at the page source reveals there is output


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD>
<BODY></BODY></HTML>

So I think the browser is considering that a custom error page and thus not thowing its own. How can I prevent the boilerplate html from being sent?

jdswebservice
07-14-2012, 05:15 AM
use this instead


header("HTTP/1.0 403 Forbidden");

refer to

http://www.codingforums.com/showthread.php?t=61558



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum