Forum Moderators: coopster
When an html file is requested the server sends a header to the browser to tell it to get ready and here is what I expect to send you.
I want to be able to capture the header from the server.
I have tried
************
<?php
foreach ($header as $a( {
print $a;
}
?>
to no avail.
Lets saythe php page send this header every time someone accesses it. I want to capture this header info or view it when it arrives.
An example of someone sending headers via php. I want to view them when they arrive.
<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>
Now to be specific as to what I am doing, is I have an auto ping system for blogs. I can enter a ping url and and the url I want to ping and a site title and it will send a ping.
I assume that if I enter a ping url that goes to my site lets say [mysite.com...]
The program will format it correctly and place the url and title in the header and send it to mysite vice a real ping site.
If I can see the header when it arrives at test.php I should be able to see the url it sent an also the title and or description of the site.
I want use that received info to send an ok back to the program to say you were successful. That way I can do some testing without aggravating the real ping people out there.
They might ban me if I hit the for test purposes.
I don't know how to access that from PHP. Sure, a lot of what is sent in the request header is parsed into the $_SERVER superglobal, so check out the PHP manual on reserved variables [us3.php.net] to see if you can find what you need. But the raw request header? Dunno about that.