var seatsReserved = []; function reserve(seat){ seat.setAttribute("class","reserved"); var hasClass = seat.classList.contains('reserved'); if (hasClass) { seatsReserved.push(parseInt(seat.innerHTML)); $.post('../index.php', { 'seatsReserved': JSON.stringify(seatsReserved) }); console.log(seatsReserved.sort(function(a, b){return a-b})); } }
$seatsReserved = json_decode($_POST['seatsReserved']);
Notice: Undefined index: seatsReserved
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)