Hello,
Is there anyway to get the HTTP Response Headers in a page?
My problem is, I have to retrieve a HTTP Response Header variable.
At my test environment I solved my problem by modifying the source of PHP.
At the test environment I use apache, so I found the function getallheaders(), but this function give me just the HTTP Request Headers, but what I needed was the HTTP Response Headers, so I modified the php_apache.c and built a function called getallresponseheaders() to get the HTP Response Headers. I recompiled PHP and It worked!
So, a test script should look like this to get the response headers with my function.
<?
header("HEADER_TEST: TEST_VALUE");
var_dump(getallresponseheaders());
?>
The result of this script should look like:
array(2) {
["X-Powered-By"]=>
string(12) "PHP/4.0.3pl1"
["HEADER_TEST"]=>
string(10) "TEST_VALUE"
}
The problem was when I tried to migrate the whole thing to my production environment. Because I use an iPlanet web server there, so my new function did not work as it is dependent from Apache.
So I returned to the begin of my problem. How can I get the HTTP Response Headers using iPlanet?
Thanks a lot!