Post query ending up in $_GET?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ian Collins

    Post query ending up in $_GET?


    I'm not sure if I've overlooked a config option, but the following HTTP
    POST request gives an empty $_POST array and $_GET['fred']=42...

    HTTP POST /js/test/testRequest.php ?fred=42 HTTP/1.1

    Pointers, clues?

    --
    Ian Collins.
  • Janwillem Borleffs

    #2
    Re: Post query ending up in $_GET?

    Ian Collins wrote:[color=blue]
    > I'm not sure if I've overlooked a config option, but the following
    > HTTP POST request gives an empty $_POST array and $_GET['fred']=42...
    >
    > HTTP POST /js/test/testRequest.php ?fred=42 HTTP/1.1
    >[/color]

    Search google for info about the HTTP protocol. A POST request should look
    something as follows:

    POST /js/test/testRequest.php HTTP/1.1
    Host: hostname.com
    Content-Type: application/x-www-form-urlencoded
    Content-Length: <length of the string 'fred=42'>

    fred=42


    JW


    Comment

    • Ian Collins

      #3
      Re: Post query ending up in $_GET?

      Janwillem Borleffs wrote:[color=blue]
      > Ian Collins wrote:
      >[color=green]
      >>I'm not sure if I've overlooked a config option, but the following
      >>HTTP POST request gives an empty $_POST array and $_GET['fred']=42...
      >>
      >>HTTP POST /js/test/testRequest.php ?fred=42 HTTP/1.1
      >>[/color]
      >
      >
      > Search google for info about the HTTP protocol. A POST request should look
      > something as follows:
      >[/color]
      I know what a post looks like, this is simply the output of a packet
      sniffer.

      Looking further at the packet I can see that the request is indeed
      malformed.

      --
      Ian Collins.

      Comment

      Working...