You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1005 B

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script>
$(document).on('click','#save',function(e) {
var vehicle = ['a','b','d'];
$.ajax({
data: {
vehicle:vehicle
},
type: "post",
url: "save.php",
success: function(data){
alert(data)
}
});
});
</script>
</head>
<body>
<form action="" id="form-search">
<input type="checkbox" name="vehicle" value="Bike"> I have a bike<br>
<input type="checkbox" name="vehicle" value="Car"> I have a car<br>
<input type="checkbox" name="vehicle" value="Boat"> I have a boat<br>
</form>
<button id="save" name="save">Serialize form values</button>
</body>
</html>
<?php
session_start();
if(isset($_SESSION['idpartie'])){
$vehicle=$_SESSION['idpartie'];
print_r($vehicle);
}
?>