Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sending Error Codes

0 views
Skip to first unread message

Andrew

unread,
Jun 18, 2004, 3:04:00 PM6/18/04
to
I am having trouble sending error codes to the
browser from my php page.

I want to send a 401 Unauthorized, and a 404 not found.

I have tried these (in seperate documents):

header("HTTP/1.0 404 Not Found");
header("Status: 401 Unauthorized");

I put a single header at the top of the page
but I received a blank document in return.

What else do I have to do send error responses
in PHP?

Thanks,

Andrew

Andrew

unread,
Jun 18, 2004, 3:11:55 PM6/18/04
to
Hmmmm...maybe this behaviour is correct?

Do I need to display my own error message or something?

Andrew

Chung Leong

unread,
Jun 18, 2004, 5:54:26 PM6/18/04
to
"Andrew" <and...@nowherenohow.com> wrote in message
news:%7HAc.5430$w07....@newsread2.news.pas.earthlink.net...

Indeed. You can print out as fancy a error message as you want. Personally I
just copy-and-pasted the HTML from the Apache error pages.


0 new messages