in this code I retrieve each product added to the cart by the user, and under each product is a 'remove' button. The problem is I want to set a hidden value for each one, and be able to get the value when the button is clicked. (I know that one way of doing this is setting the same name to the type= submit buttons but set their values different from each other, but the values would appear on the button itself, which i don't want.) Thank you in advance.
while ($isready= mysqli_fetch_array($getinfo))
{
echo "<br>$isready[1] $isready[2] BD $isready[4]";
echo '<br><input name="removefromcart" type="submit" value="remove">';
echo '<input type=hidden name="removed" value="'.$isready[0].'"">';
$i++;
}`enter code here`
$mult= $isready[2]* $isready[4];
$total= $total +$mult;
echo "<br><br>$total BD";
if (isset($_POST['removefromcart']))
{
$removebutton=$_POST['removefromcart'];
$conn->query("DELETE FROM `addedtocart` WHERE ID=$removebutton");
$conn->query("ALTER TABLE addedtocart AUTO_INCREMENT=$removebutton");
}