Bad Request Header

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Ree
Forum Regular
Posts: 592
Joined: Fri Jun 10, 2005 1:43 am
Location: LT

Bad Request Header

Post by Ree »

What is the correct string I should pass to header() to output a 400 page?
Last edited by Ree on Mon Oct 16, 2006 3:52 am, edited 1 time in total.
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

the correct page with correct path.
Ree
Forum Regular
Posts: 592
Joined: Fri Jun 10, 2005 1:43 am
Location: LT

Post by Ree »

I thought something like

Code: Select all

header('HTTP/1.1 400 Bad Request');
would work but it doesn't. Do I need to configure something?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Can you define how it doesn't work?
Ree
Forum Regular
Posts: 592
Joined: Fri Jun 10, 2005 1:43 am
Location: LT

Post by Ree »

My idea was to display a 404 page to the client (the server should use whatever html page it has for that purpose). The above header does not force this behaviour.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You're artificially implementing that behaviour thus you have to build it yourself. The server doesn't pay attention much to what's being written to the output by PHP.
Post Reply