There is such a basket page:

<?php if(isset($_POST['submit'])){ foreach($_POST['quanity'] as $key => $val) { if($val==0) { unset($_SESSION['cart'][$key]); }else{ $_SESSION['cart'][$key]['quanity']=$val; } } } ?> <h1>View Cart</h1> <a href="index.php?page=products">Go back to products page</a> <form method="post" name="form" action="index.php?page=cart"> <table> <tr> <th>Name</th> <th>Quanity</th> <th>Price</th> <th>Items Price</th> </tr> <?php require("includes/connection.php"); $connect = mysqli_connect($server, $user, $password, $db); $sql="SELECT * FROM products WHERE id IN("; foreach($_SESSION['cart'] as $id => $value) { $sql.=$id.","; } $sql=substr($sql, 0, -1).") ORDER BY name ASC"; $query=mysqli_query($connect, $sql); $totalprice=0; while($row=mysqli_fetch_array($query)){ $subtotal=$_SESSION['cart'][$row['id']]['quanity']*$row['price']; $totalprice+=$subtotal; ?> <tr> <td><?php echo $row['name'] ?></td> <td><input type="text" name="quanity[<?php echo $row['id'] ?>]" size="5" value="<?php echo $_SESSION['cart'][$row['id']]['quanity'] ?>" /></td> <td><?php echo $row['price'] ?>$</td> <td><?php echo $_SESSION['cart'][$row['id']]['quanity']*$row['price'] ?>$</td> </tr> <?php } ?> <tr> <td colspan="4">Total Price: <?php echo $totalprice ?></td> </tr> </table> <br/> <button type="submit" name="submit">Update Cart</button> <input type="text" name="fio" placeholder="Укажите ФИО"> <input type="text" name="email" placeholder="Укажите e-mail"> <button type="submit" name="order">Отправить</button> </form> <br /> <p>To remove an item, set it's quanity to 0. </p> 

How to send its contents (goods, price, etc.) to email without global changes in the code?

0