A
A
Angelxalfa2017-01-20 11:01:02
linux
Angelxalfa, 2017-01-20 11:01:02

Why doesn't passing an array via POST work?

Good day. There is a need to transfer an array via POST.
For this I use inputs of the form

<input class="hidefield" hidden="hidden" type="text" name="devices['<?php echo $ipu_data['base_id']; ?>'][base_id]" value="<?php echo $ipu_data['base_id']; ?>">
.
Everything worked on one server - transferred to a working server - does not work.
I do var_dump($_POST). - There is no devices element at all.
At the same time, ordinary inputs were transferred correctly (of the form:
<input class="hidefield" hidden="hidden" type="text" name="company" value="<?php echo $_POST['company']; ?>">

)
Tell me please, where to dig? Maybe there is some setting that prohibits such a transfer via POST? After all, on the other server everything worked without problems!
HTML form output
<form action="http://site.ru" method="post">
  <input class="bs form-control new_meterage_input" type="text" name="devices['2'][new_meterage]" value="blabla" >
  <input class="hidefield" hidden="hidden" type="text" name="devices['2'][base_id]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['2'][search]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['2'][id]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['2'][street]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['2'][house_number]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['2'][app_number]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['2'][device_id]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['2'][description]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['2'][device_type]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['2'][old_meterage]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['2'][c_kod]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['2'][block]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['2'][base]" value="blabla">
  
  <input class="bs form-control new_meterage_input" type="text" name="devices['6468'][new_meterage]" value="blabla" >
  <input class="hidefield" hidden="hidden" type="text" name="devices['6468'][base_id]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['6468'][search]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['6468'][id]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['6468'][street]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['6468'][house_number]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['6468'][app_number]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['6468'][device_id]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['6468'][description]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['6468'][device_type]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['6468'][old_meterage]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['6468'][c_kod]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['6468'][block]" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="devices['6468'][base]" value="blabla">

  <input class="hidefield" hidden="hidden" type="text" name="company" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="street" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="house_number" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="appartment_number" value="blabla">
  <input class="hidefield" hidden="hidden" type="text" name="id" value="blabla">
  <input type="submit" name="ipu_save_submit" class="btn btn-default" value="Сохранить">
</form>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kpa6uu, 2017-01-20
@Angelxalfa

You can shorten the code using this wonderful construction:
To parse the error, discard the html of the resulting form, maybe you messed up with quotes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question