prova a stampare l'array $_SESSION.....
vedi un po' cosa valorizzi nel $_SESSIONCodice PHP:if (isset($_GET['buy'])) {
// Add item to the end of the $_SESSION['cart'] array
$IDaggiungi = $_GET['buy'];
$_SESSION['cart'][$IDaggiungi]++;
echo "<pre>";
print_r($_SESSION);
// header('location: ' . $_SERVER['PHP_SELF'] . '?' . SID);
exit();
}

Rispondi quotando