Server Status?

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
Vahn
-


Joined: 10 Aug 2005
Posts: 51
Location: At my computer

PostPosted: Thu Sep 14, 2006 3:52 am    Post subject: Server Status? Reply with quote

Back again with more Mind Boggling questions:

i was wondering if the server sent what status code it got to php in any shape or form ( such as when it was a fine deal it would send to say $_SERVER['Status_code'] = 200 and a 404 would be 404 insted of 200, ya follow...

if this is done it would be greately appreciated, if not any ideas how to get that code Via php?
_________________
A ship in the harbor is safe, But thats not what Ships were Built for. ~ John Shedd
Success Comes before Work only in the Dictionary ~ Harvey Mackay
Back to top View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Thu Sep 14, 2006 7:04 am    Post subject: Reply with quote

Run this PHP script as your 404 error page and check for the Error code under
the "REDIRECT_" variables. Hope this information helps you.

Code:
<?php
phpinfo();
?>


Sincerely, TRUSTAbyss
Back to top View user's profile Send private message Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Thu Sep 14, 2006 11:38 am    Post subject: Re: Server Status? Reply with quote

Vahn,

REDIRECT_STATUS_CODE is the CGI var you're looking for.

http://www.aprelium.com/data/doc/2/abyssws-win-doc-html/cgivars.html reads:

Quote:
If the request results from an internal redirection (from an SSI document or if it is used as a custom error page for example), the environment variables of the parent request are also added and each variable name is prefixed by REDIRECT_. The parent request's status code is stored in the special variables REDIRECT_STATUS and REDIRECT_STATUS_CODE. The cookies of the parent request are also passed to the redirected request in the COOKIES environment variable. REDIRECT_STATUS_CODE may seem redundant but it is actually useful when with PHP scripts as some PHP configurations require setting REDIRECT_STATUS to a fixed value.

_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group