BWGames scribbled something along the lines of:
Hi,
I have a application that is accessing a php script via HTTP, and I will
need the script to return anything other than HTTP 200 OK, using PHP
occasionally.
What code can I use to make a HTTP error returned?
Thanks,
Ben
http://www.php.net/header
The header() function does pretty much what you want. Just find the
right header to send. For some real life examples, get a browser that
lets you look at the headers it receives and look at the log when
encountering exactly that error.
Note that you need to "fake" the error documents still, even if you send
the right header. MSIE might show the "friendly" MSIE-error pages
instead if the setting has not been deactivated, but most other browsers
will show what the server sends.
Take a look at the error documents that come with the server software
and just copy the markup to the php file.
--
Alan Plum, WAD/WD, Mushroom Cloud Productions
http://www.mushroom-cloud.com/