Variable $ _POST has size limit?

2

I'm working with the $_POST variable on a particular part of the system I'm developing, except that when I make a submit of a POST-type form not all information is passed to this variable $_POST .

Is there any limit size for variables of type $_POST , and if there is, how could I circumvent this?

    
asked by anonymous 17.11.2014 / 16:48

3 answers

3

Yes, $_POST has a maximum limit defined by the post_max_size setting of PHP, but this value is usually sufficient for textual information.

It would be interesting to check if you do not have name attributes repeated in the form that is sent, as this can cause the information in one field to replace that of another.

EDIT: Based on your comment that you are trying to send an array, you can do this:

<input name="nota[0]">
<input name="nota[1]">
<input name="nota[2]">
<input name="nota[3]">

You can access notes in the array using $_POST['nota'] .

    
17.11.2014 / 16:53
2

This is a server throttling, if it is the php.ini and searching for post_max_size you can check what size limit you have to pass data through POST .

Or change through .htaccess to the value you require:

#definir tamanho máximo de POST
php_value post_max_size 20M
    
17.11.2014 / 16:55
1

POST can be blocked by two configuration variables.

The first one already mentioned in the other answers is post_max_size , which controls the limit amount in MB that can be received via POST.

The second variable is max_input_vars that was introduced in php 5.3.9 to prevent HashDOS attacks. This variable controls the amount of fields that can be sent by POST / GET and is usually set with a limit of 1000 fields.

I recommend taking great care when changing any of these variables, as they already have low values to avoid problems with% Denial Of Service

In case you are browsing with files it is interesting to note that there is a directive that controls this too: DOS - Controls how many MB can be sent in Uploads.

    
18.11.2014 / 14:31