Re: Can i get the full HTTP-Header without patching PHP?
| From: | Bernd Kohnen | Date: | Thu, 12 Jul 2001 12:02:55 +0000 |
| Subject: | Re: Can i get the full HTTP-Header without patching PHP? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-57577@lists.php.net to get a copy of this message | ||
"Peter Clarke" <peterNOSPAMjingo.com@pb1.pair.com> schrieb im Newsbeitrag
news:20010712092251.89094.qmail@pb1.pair.com...
>
> "Rainer Kohnen" <rainerkohnen@yahoo.com> wrote in message
> news:20010712071545.19025.qmail@pb1.pair.com...
> > Hi,
> >
> > is there a way to get the full HTTP Header
> > without patching PHP?
> >
> > I use a debugger coded in PHP a lot. Now i need
> > to debug some intershop enfinity pages. However,
> > enfinity uses a lot of fields with the same names.
> > So my debugger overwrites the variables and i get
> > only the last one. As i cant change the code
> > (wouldn't work anymore then) i cant debug without
> > having access to the full http header.
> > (i can make arrays for duplicate variables for
> > myself then)
> >
> > Same problem with some kind of e-cash system.
> > It validates itself by putting a signature into
> > the header. However, PHP cant validate the header
> > as i have no chance to get the original header.
> > (And i cant rebuild the original header of course)
> >
> > If there is no way without patching to
> > get these informations are there any plans to
> > integrate a function for getting the header
> > in future versions of php?
> >
> > thanks
> >
>
> Have you tried:
> http://www.php.net/manual/en/function.getallheaders.php
> $headers = getallheaders();
> while (list ($header, $value) = each ($headers)) {
> echo "$header: $value<br>\n";
> }
Yes, did not work for me.
What i need is the exact content of a POST and the
header itself.
For example: when i check the signature of a header,
how can i know if the header contains:
Content-Type: application/x-www-form-urlencoded
or
Content-Type: application/x-www-form-urlencoded
(note the extra space)
So what i like to have is the exact POST request sent
from the users browser to the apache server as
a single string oder array of strings for each line
(not parsed!).
A POST may look like this:
---
POST /anmeldung_index.html HTTP/1.0
Host: www.testserver.work
Content-length: 67
fstatus=1&username=peter&search=banana&search=drink&search=daiquiri
---
As you can see there are 3 times "search" in the POST.
PHP itself will give me only the last one but if i can get
the original request its easy to parse it into an array for
myself.
The other problem is with authentication signature:
---
POST /anmeldung_index.html HTTP/1.0
Host: www.testserver.work
signature: 43jgb34u545u6FGH3456hjSDFg2345456-dfg43j45h6gGFGH
Content-length: 67
fstatus=1&username=peter&search=banana&search=drink&search=daiquiri
---
To verify this i need the exact request, as a string,
not preparsed in any form.
Thanks anyway :)