getConnection(); $sid = trim($_POST['sid']); $pid = trim($_POST['pid']); $qty = trim($_POST['qty']); $_SESSION['CART'][] = array("pid" => intval($pid), "qty" => intval($qty)); http_response_code(200); echo json_encode( array( "status" => 200, "cart" => $_SESSION['CART'] )); ?>