Accessing raw client HTTP headers
Moderator: General Moderators
Accessing raw client HTTP headers
Is there anyway to access the raw HTTP headers (from PHP) the user sent to your webserer? A lot of the information can be retrieved in other ways, such as cookies through $_COOKIE, etc, but I'm creating a psuedo-proxy type thing and it would handy if I didn't have to go to all those different places.
headers_list() returns the headers to be sent to the client. Maybe (likely) my first post wasn't clear, but I'd like to be able to get the headers the client sent (to the server). IE, I'd like to be able to get the raw/numerically indexed
the client sent to retrieve my document from the webserver.
Code: Select all
GET /index.php HTTP/1.1
Host: texan.homeunix.net
Cookies: PHPSESSID=10293n12n3n49182312121212;
Other-header: blargaration
Etc: eteraI'm going to cheat and give a roundabout answer. It can be done, and it looks like this: http://phpsniff.sourceforge.net/
Check their code (its relatively small and fairly well organized) for the methods.
Please let me know if I misunderstood the original question.
Check their code (its relatively small and fairly well organized) for the methods.
Please let me know if I misunderstood the original question.