Variable $_POST has size limit?

Asked

Viewed 3,993 times

2

I’m working with the variable $_POST in a certain part of the system I am developing, only when I do a submit not all information is passed to this variable $_POST.

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

  • 1

    Post the client code that is performing the POST request.

3 answers

3

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

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

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

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

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

  • It turns out that the Names are three: nota_1, nota_2 and nota_final, because it is a bulletin, these names are followed by [] to send arrays with information, what happens is that this array does not send all the data that is in the form.

  • @Kaluã See my edited reply and see if it helps you.

  • Now imagine there an array containing a lot of the data of the form in question, the problem is that not all the data is being stored inside this array, if we follow the vc Falow at the beginning, only one information for each name would be there, only that the reality is that there is data in the array only that there is also data that is not being entered in this array.

2

That’s a server limitation, if it’s php.ini and search for post_max_size can verify which limit size has to pass data through POST.

Or change through .htaccess for whatever value you need:

#definir tamanho máximo de POST
php_value post_max_size 20M

1

POST can be blocked by two configuration variables.

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

The second variable is the max_input_vars which was introduced in php 5.3.9 to prevent Hashdos type 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 to be very careful when changing any of these variables, since they already have low values to avoid problems of DOS (Denial Of Service)

In case you are messing with files it is interesting to note that there is a directive that controls this too: upload_max_filesize - Controls how many MB can be uploaded.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.