Form loses information passed by POST

Asked

Viewed 30 times

1

I have a form that contains a total of 45 textarea (I will post only the first part here).

When do I send this information from form one-page PHP, that only displays what has been passed by POST, part of the information is not received.

Form:

<form action="./?p=upg&f=agenda" id="autoForm" method="post">

Textareas:

<td><textarea class="w100 form-control send" rows="4" name="cp1"></textarea></td>
<td><textarea class="w100 form-control send" rows="4" name="cp2"></textarea></td>
<td><textarea class="w100 form-control send" rows="4" name="cp3"></textarea></td>
<td><textarea class="w100 form-control send" rows="4" name="cp4"></textarea></td>
<td><textarea class="w100 form-control send" rows="4" name="cp5"></textarea></td>

PHP page:

print_r($_POST);

Even when I fill out all the textarea and send the form, only displays the first element, the rest appear empty.

Array ( [id] =>  1 [cp1] => CAMPO1 [cp2] => [cp3] => [cp4] => [cp5] => [cp6] => [cp8] => [cp10] => [cp9] => [cp12] => [cp15] => [cp16] => [cp20] => [cp25] => [cp18] => [cp24] => [cp30] => [cp7] => [cp14] => [cp21] => [cp28] => [cp35] => [cp32] => [cp40] => [cp27] => [cp36] => [cp45] => )
  • 2

    It doesn’t make much sense no. Should pass the values :/

  • 1

    Does your form make the Submit pure or do you have some script that handles the data before? Look at this one print a script running exactly as "told by you", with 45 "cp" fieldsx"... Another thing: your print_r() is only returning 28 fields, and in the question you said there are 45... Post your full code there to see. You probably have something on this data and you didn’t notice...

  • I discovered the error. I don’t really know what happened, but several textarea fields were with repeated names. Thanks for the help. I think I’ve been so much trying to observe other things that could give the error and looking only at the first fields that I didn’t notice that PHP returned a lower amount of fields than what I was sending. Thank you very much.

No answers

Browser other questions tagged

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