How do I add ‘productID’ to the session to be different from the others?
Information that accepts
$ _POST ["pColors"]: 1, 2, 3, 4
$ _POST ["productID"]: 3, 4
Example: To get for id [3] => 1,2,3,4 and for id [4] => 1,2
if(isset($_POST['action'])) {
if(($_POST['pColors'] != "") & ($_POST['productID'] != "")) {
$_SESSION['productID'] = $_POST['productID'];
foreach($_POST['pColors'] as $key => $color) {
$_SESSION['pColors'] = $_POST['pColors'];
}
}
}