I have an edit form (change the quantity and delete) of the goods selected by the user. The form itself is formed by a cycle, that is, there are 2 inputa:
<input type="number" name="col" class="coltbl" value="<?php echo $row['tvr'];?>" /> <input type="checkbox" name="delite" value="<?php echo $row['tvrid'];?>" /> Important: the "Save" button is outside the cycle - the total for the entire withdrawal of goods.
The task is that it is not clear how to initialize the edited product in the handler. And if the checkbox carries the necessary information in its arsenal via value (this is the id of the product being edited), then here’s the first step in the problem: the value is the quantity and identifying it with a specific product is problematic ...
Remembered about arrays:
name="col[<?php echo $tvrid;?>]" And now I do not understand what to do next in the handler. Thank!
$_POSTwill turn out to be a pretty array ofproducts, in which the keys are the product IDs. - etki