Req #17204 [Opn]: getallheaders() not available in all SAPIs
| From: | ajf@php.net | Date: | Thu, 08 Jan 2015 22:28:22 +0000 |
| Subject: | Req #17204 [Opn]: getallheaders() not available in all SAPIs | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-189758@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=17204&edit=1
ID: 17204
Updated by: ajf@php.net
Reported by: phpuser at infomediaire dot be
Summary: getallheaders() not available in all SAPIs
Status: Open
Type: Feature/Change Request
Package: *Web Server problem
Operating System: NT
-PHP Version: 4.2.0
+PHP Version: 5.6.0
Block user comment: N
Private report: N
New Comment:
It's currently supported by Apache, NSAPI (lol), FPM and the CLI server, but it should probably
be supported in other places, too.
Upping version to 5.6.0 as it's still relevant today.
Previous Comments:
------------------------------------------------------------------------
[2002-07-04 09:24:41] sniper@php.net
There is no way at the moment. Making this feature request.
------------------------------------------------------------------------
[2002-07-04 05:58:09] phpuser at infomediaire dot be
Thank you to all for the comments.
As far as I understand now (it was not clear to me while reading the doc), there is no way for me to
get the
full http header of the request made by the client.
Only the variables (from a filled form) are available.
In my example, the request made by the client contains no
field at all. What is the equivalent of "getallheaders" while running PHP not as an apache
module but standalone ?
------------------------------------------------------------------------
[2002-06-18 16:30:03] sniper@php.net
Please add the whole script, not just some part of it..
And $_GET will always be empty, if you don't pass any
values in the URL. e.g. access the script http://www.example.com/myscript.php?somevar=somevalue
------------------------------------------------------------------------
[2002-05-14 07:47:32] phpuser at infomediaire dot be
I'm using PHP 4.2.0. standalone (not as an apache module) on Apache 1.3.22 on NT 4.0 with SP6
(nobody's perfect ;)).
The following script
echo (count($_ENV)."<br>");
echo (count($_SERVER)."<br>");
echo (count($GLOBALS)."<br>");
echo (count($_GET)."<br>");
echo (count($_REQUEST)."<br>");
echo (count($HTTP_GET_VARS)."<br>");
give as result
31
34
48
0
0
0
The result is the same with register_globals set to on or off.
I want to access to each byte send in the HTTP header by the browser, even if some fields are not
foreseen by RFC's.
Of course I can have a look on Globals but I'm not sure
- that each line of the HTTP request will be there
- of what $Globals originate from the server or from the client.
Does anybody have the same problem ? Is it a bug ?
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=17204&edit=1