Re: Show the entire browser request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 8, 2009 at 4:40 PM, Dotan Cohen<dotancohen@xxxxxxxxx> wrote:
>> This should do it, I believe:
>>
>> <?php
>>
>> echo $_SERVER['REQUEST_METHOD'], ' ', $_SERVER['REQUEST_URI'], ' ',
>> $_SERVER['SERVER_PROTOCOL'];
>>
>> ?>
>>
>
> Thanks, Andrew, I'm sure that works for correctly-formed requests.
> However, I am trying to diagnose a web browser that is _not_ correctly
> forming it's requests, therefore I need the real request itself, as it
> was.
>
> I am starting to realize that PHP is not the language for this, I may
> have to look into an Apache module or something lower-level. Thanks!
>
> --
> Dotan Cohen
>
> http://what-is-what.com
> http://gibberish.co.il
>

I think you're probably correct. I would imagine the request has to be
at least well formed enough for the $_SERVER variables to be populated
in order for it to even get into PHP. Otherwise, the web server
wouldn't know what to do with it. The request method itself would have
to be something that PHP is told to handle (which from what I've seen
is usually only GET, POST or PUT, though other methods could be
configure); if the request_uri is messed up, it will generally result
in a 404 because the resource can't be found rather than a BAD REQUEST
response. I'm not sure what impact the protocol part of that line has.

For what you want, you probably need to write your own socket server
to listen for the request and echo it back to the client.

Andrew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux