Re: Sending raw headers

From: Date: Fri, 30 Jun 2000 07:01:14 +0000
Subject: Re: Sending raw headers
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-3967@lists.php.net to get a copy of this message
> Hi, > > I have a simple script called test.php3 which looks like this: > > <?php > header("http/1.0 404 Not Found"); > ?> > > Now, this should throw up a 404 error, but it doesn't. It simply displays a > blank page. > > Can anyone tell me what I am doing wrong? First, case is significant here. Try this: Header("HTTP/1.0 404 Not Found"); Second, what are you expecting it to display? Youare not sending any error text. The default Apache error page throws up some text. Since you are now doing this directly with PHP, you have to send this text. eg. <? Header("HTTP/1.0 404 Not Found"); echo "<P>$REQUEST_URI not found!</P>\n"; ?> -Rasmus

« previous php.general (#3967) next »