Is there a way to receive the value of a label or other element that is next to an input by php? I have the following code.
<div class="formulario__category__plates">
<?php $platos = mysqli_query($conexion, $pCombinations);
while ($row = mysqli_fetch_assoc($platos)) { ?>
<label class="formulario__plate__name"><?php echo $row ['name_plate'];?></label>
<p class="formulario__plate__price"><?php echo number_format($row ['price_plate'], 2);?></p>
**<input type="text" class="formulario__plate__input" value="0" name="combinations[]">**
<input type="hidden" value="<?php echo $row ['price_plate'];?>">
<?php } mysqli_free_result($platos);?>
</div>
I am sending some inputs as an array per post (which is in bold). And I already know how to receive them, but I also want to get the name and price of the input where some value has been written. But I have no idea how to do it. I hope you can help me. What I'm trying to do is something like this: link in the part where you put the number of dishes. Thanks.