A
A
ART42019-04-26 11:43:48
PHP
ART4, 2019-04-26 11:43:48

Increase +1 when sending a post?

Good afternoon.
I made a form , it has input

<input type="text" name="data1[{$num+1}]" value="{$purchase->variant->sku|escape}">

Here name="data1 [{$num+1}] " - +1 is added each time
5cc2c41bb7bc6191018475.png
The form is sent to the send.php file when it is sent.
It has the following construction: Then date1[2] is sent, but it is necessary that
$product[] = $_POST[data1][$num+1];
  • date1[1]
  • date1[2]

and so on...
I sent a couple of values ​​and not one. Help me solve this please

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anatoly, 2019-04-26
@ART4

foreach ($_POST['data1'] as $value) {
    $product[] = $value;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question