jQuery to PHP: no input... kinda

Posted by Seva Alekseyev on Stack Overflow See other posts from Stack Overflow or by Seva Alekseyev
Published on 2010-06-02T17:22:07Z Indexed on 2010/06/02 17:34 UTC
Read the original article Hit count: 375

Filed under:
|
|
|

Hi all,

I'm using jQuery to post HTTP requests to my PHP page (Apache/Linux, if that matters). I carefully validate on the client so that empty requests are not sent. However on occasions, I'd get an empty request like this:
- $_POST collection empty ($_GET collection also empty);
- Content-Length is nonzero (a number below 100, consistent with a valid POST from my script)
- Content-Type properly application/x-www-form-urlencoded
- reading from php://input yields an empty string

It's as if $_POST is somehow eaten on the way. I checked the code very carefully - I don't do anything to the contents of $_POST.

Any ideas, please?

© Stack Overflow or respective owner

Related posts about php

Related posts about jQuery