Forum Moderators: coopster

Message Too Old, No Replies

How do I access the raw header info sent from a browser?

         

crustymonkey

3:01 am on Jun 17, 2004 (gmt 0)

10+ Year Member



I am wondering if there is a way to access the actual, unparsed header information that is sent from the browser to the server.
ex.:

POST /page.php HTTP/1.0
User-Agent: Frontier/5.1.2 (WinNT)
Host: somewhere.com
Content-Type: text/html
Content-length: 181

I know that there are a number of globals that can access parts of that like the user agent, but I can't find any global, or function, to just access that raw, unparsed information.

Thanks.

Crustymonkey

Timotheos

4:04 pm on Jun 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you got PHP5 then check out headers_list [php.net].

chadmg

4:20 pm on Jun 17, 2004 (gmt 0)

10+ Year Member



headers_sent() might be a better function.

Timotheos

4:28 pm on Jun 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Headers_sent is just a boolean value, ya or nay if they've been sent. I think he wants all the info on what was sent.

helmet

5:54 pm on Jun 17, 2004 (gmt 0)

10+ Year Member



Install the Firefox browser and get this: [chrispederick.com...]

volatilegx

6:33 pm on Jun 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could try the php function getallheaders(), which returns all of the headers in an associative array. Then, using a join() function, you could flatten the array to the same format they were in the first place.

crustymonkey

11:33 pm on Jun 17, 2004 (gmt 0)

10+ Year Member



Volatilegx hit the nail right on the head. That is exactly what I was looking for. I'm building a custom SOAP page and I needed to be able to get the SOAPAction header.

Thanks guys.