A
A
Alexander2018-08-08 12:13:56
PHP
Alexander, 2018-08-08 12:13:56

Why is part of the $_POST array truncated when submitting the form?

Hello colleagues!
There is a form with a large number of fields (50+) and two submit buttons:

<form name="form" enctype="multipart/form-data" method="post" action="...">
   <button type="submit" name="submit">Сохранить</button>
   <button type="submit" name="submit_enabled">Включить</button> 
   ...поля...
</form>

On the backend, the code that handles pressing both buttons is the same (!).
The essence of the problem: When you press the "Save" button, all the data comes to the backend (the entire $_POST array), and when you press the "Enable" button, sometimes (!) the full data comes (part of the $_POST array is cut off at the end). Moreover, it is not always cut off on the same character - but "floats".
The following settings are on the server (PHP 5.6):
max_input_vars = 5000
post_max_size = 256M
memory_limit = 2048M

It seems to me that it's not in my code. What then? Server settings? Bug in php?
Can anyone come across?
Thank you.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexander, 2018-08-08
Madzhugin @Suntechnic

I don’t know what the problem is, but I know how I would look - I would try my best to achieve repeatability.

sometimes (!) come to full data
- so you won't find anything.
Catch the clipped data and resend with the same data - again it was clipped, but not with the others? Look for the difference in the data.

P
psfpro, 2018-08-08
@psfpro

You need to check what is sent to the server in the developer console in the browser. Perhaps the problem is in the layout of the form with a large number of fields.

A
Anton fon Faust, 2018-08-08
@bubandos

Look for the bug in one of the fields or one of the values.

R
Roman, 2018-08-08
@GUY

Try to send a save request via rest http tools, if the result is the same problem on the backend, if not, then on the layout

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question