<?php
var_dump($_POST);
?>
<!DOCTYPE HTML>
<html>
<head></head>
<body>
<div id="resultmsg"></div>
<input type="text" name="price1" value="4">
<input type="text" name="price2" value="3">
<input type="text" name="level" value="2">
<input type="text" name="level2" value="1">
<input type="button" value="Send" id="send">
<script type='text/javascript' src='http://code.jquery.com/jquery-1.9.1.js'></script>
<script>
$(function(){
$("#send").on("click", function(){
var price = $("input[name^=price]").map(function () {
return $(this).val();
}).get();
var level = $("input[name^=level]").map(function () {
return $(this).val();
}).get();
$.post('send.php', {
price: price,
level: level
}, function (data) {
$("#resultmsg").html(data);
});
});
});
</script>
</body>
</html>