<form method="post" action="cart.php?action=add&code=<?php echo $product_array[$key]["code"]; ?>"
<div class="product-image"><img src="<?php echo $product_array[$key]["image"]; ?>"></div>
<div><strong><?php echo $product_array[$key]["name"]; ?></strong></div>
<div class="product-price"><?php echo "₹ ".$product_array[$key]["price"]; ?></div>
<div><input type="Number" name="quantity" value="1" size="2" min="0.5" max="10" step="0.5" style="border-radius: 50px;width: 70px;height: 40px; border-style: ridge;text-align: center;" /><input type="submit" value="Add to cart" class="btn btn-warning" /></div>
<b>Note: Quantity should be in KG's</b>
</form>
</div> adding previous item when page reloads