I would like to ask for help, I am still a beginner in php systems and language. I’m trying to create an online store and I have several subpages, including the “shop” and each product has a separate subpage. The checkout system is also on a separate page. I have no idea how to display several selected products at the same time on the checkout page.I transfer the data of individual products to the checkout page from the individual product subpages as follows:
<a href="cart.php?action=add&product_name=<?php echo urlencode($product_name); ?>&product_price=<?php echo $product_price; ?>&product_picture=<?php echo urlencode($product_picture); ?>&quantity=1&size=<?php echo urlencode($size); ?>" id="addToCartBtn" class="normal">Add To Cart</a>
This is how I get the extracted data on the checkout page:
<?php
if(isset($_GET['product_name']) && isset($_GET['product_price']) && isset($_GET['quantity']) && isset($_GET['product_picture']) && isset($_GET['size'])) {
$product_name = $_GET['product_name'];
$product_price = $_GET['product_price'];
$quantity = $_GET['quantity'];
$product_picture = $_GET['product_picture'];
$size = $_GET['size'];
?>
My question would still be how it could be implemented so that the selected products are stored on the checkout page and do not disappear if I go to another subpage.
i tried creating php SESSION but it didn’t work.


