There is a simple form using AJAX - 2 text fields and a button to send values:
<form method="post" name="chooseProduct" class="choose-product-form"> <input type="text" name="product" placeholder="Название продукта"> <input type="text" name="portion" placeholder="Размер порции"> <input type="button" value="Добавить" id="addProduct"> </form> Each time you press the button, the values (float) are added to the previous ones and all this is saved to the session variable.
Can PHP clear the session variable when the page is updated (reloaded) using PHP ?
unset($_SESSION['someValue'])? - Vasily Barbashev