I am working on a movie ticket booking database using Mysql and PHP.I've done the frontend part using HTML,CSS. The below code is to change the image of the selected seat.The Available seats are shown in red,the booked ones are white. When the user clicks on a red image it'll turn to black,to show that the seat has been selected.But i need the list of seats which are selected by the user,in other words, i want the name of the seats,the user have booked.All seats have a seat name associated with the image.I'm stuck at this point,the seat names are stored in "seats" array of javascript. But i need this data into php to update the same into my database.I've no knowledge on JSON,AJAX.etc. please help me resolve this. Thank you.
<script > var seats=[]; function sample(id){ document.getElementById(id).src="https://image.flaticon.com/icons/png/512/24/24868.png"; seats.push(id); alert(seats); } </script>