Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP some $_POST values missing but are present in php://input
    primarykey
    data
    text
    <p>I have a very big html form (containing table with rows, which contain multiple inputs), which i need to submit to PHP script via POST request. The problem is some values don't come through and are absent in PHP's $_POST superglobal.</p> <p>I checked (using Firebug extension) that the values are actually sent to server by the browser.</p> <p>$_POST gets populated, but some values are just missing.</p> <p>I checked what is raw request using:</p> <pre><code>$raw_post = file_get_contents('php://input');</code></pre> <p>and the string returned has the values. They are just not parsed into $_POST array. The strange thing i noticed is, it seems that the php://input values are cut after some length, and rest of the string does not come through to $_POST.</p> <p>I thought about post_max_size and memory_limit and set them to large values: <pre><code>memory_limit = 256M post_max_size = 150M</pre></code> but according to php documentation $_POST should not contain any values if request made is bigger than post_max_size.</p> <p>Due to big size of form and request I cannot post it here, but i can post php script i used to debug the problem:</p> <pre><code> var_dump($file = file_get_contents('php://input')); var_dump($_POST); //... then i parsed the $file </code></pre> <p>Server version: Apache/2.2.9 (Debian)<br> PHP version: PHP 5.3.2-0.dotdeb.2</p> <p>Can enyone explain reason of such strange PHP behaviour, and what should i do (change php settings, code?) to use $_POST array while processing form?</p> <p>EDIT: To be clear: not only the values are missing. $_POST does not contain these keys either.</p> <p>e.x. fragment of raw post: </p> <pre><code>t_dodparam%5B198%5D=&t_dodparam2%5B198%5D=&t_kolejnosc%5B198%5D=199&n_indeks=201&n_wartosc=testtesttest</code></pre> <p>Key 't_dodparam' is in post and it has key 198. The rest of parameters are missing (e.x. t_dodparam2 is in post, but it has no such key as 198, and there is no such key as n_wartosc in $_POST)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload