Re: [PHP] HTTP request contents
From: Chris Shiflett (shiflett_at_php.net)
Date: 10/24/03
- Next message: Matt Palermo: "Using PHP with JAVA"
- Previous message: Chris Shiflett: "Re: [PHP] php header function"
- In reply to: Hanuska Ivo: "HTTP request contents"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 24 Oct 2003 06:52:59 -0700 (PDT) To: Hanuska Ivo <hanuska@asd-software.cz>, php-general@lists.php.net
--- Hanuska Ivo <hanuska@asd-software.cz> wrote:
> I need to know, if there is a possibility to read full contents of
> HTTP request. I know, the response can be sent by header() function.
> But can I get the request of the client for server?
In a way, yes, although most of this information is nicely parsed for you by
the time PHP has its turn. Look in the $_SERVER superglobal for many of the
headers:
print_r($_SERVER);
Most headers (I think all) begin with HTTP, as in $_SERVER['HTTP_USER_AGENT']
for the User-Agent header. The request line itself is broken into the method,
requested resource, and version.
There is also a nice function called apache_request_headers:
http://www.php.net/apache_request_headers
If you're using an older version, this might be called getallheaders.
Hope that helps.
Chris
=====
My Blog
http://shiflett.org/
HTTP Developer's Handbook
http://httphandbook.org/
RAMP Training Courses
http://www.nyphp.org/ramp
- Next message: Matt Palermo: "Using PHP with JAVA"
- Previous message: Chris Shiflett: "Re: [PHP] php header function"
- In reply to: Hanuska Ivo: "HTTP request contents"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|