i want to add an select option for the size of product and put it on cart but I don't know where to start, can anyone guide mo on how to add selected product sizes to cart
<?php
session_start();
error_reporting(0);
include 'connections.php';
if(isset($_GET['action']) && $_GET['action']=="add"){
$id=intval($_GET['id']);
if(isset($_SESSION['cart'][$id])){
$_SESSION['cart'][$id]['quantity']++;
}else{
$sql_p="SELECT * FROM products WHERE id={$id}";
$query_p=mysqli_query($con,$sql_p);
if(mysqli_num_rows($query_p)!=0){
$row_p=mysqli_fetch_array($query_p);
$_SESSION['cart'][$row_p['id']]=array("quantity" => 1, "price" => $row_p['productPrice'],);
}else{
$message="Product ID is invalid";
}
}
echo "<script>alert('Product has been added to the cart')</script>";
echo "<script type='text/javascript'> document.location ='products.php'; </script>";
}
?>