I am facing problem while sendingsome arrays and data to a page but it is not getting posted i tried print_r($_POST); but its showing Array() as output and other data is also not being posted
The script is as follows:
<script type="text/javascript">
$(document).on('click', "#submitr", function(){
var favorite = [];
var tag = [];
var type = [];
var scheme = [];
$.each($("input[name='pcheck']:checked"), function(){
favorite.push($(this).val());
});
$.each($("input[name='tag[]']"), function(){
tag.push($(this).val());
});
$.each($("input[name='type[]']"), function(){
type.push($(this).val());
});
$.each($("input[name='scheme[]']"), function(){
scheme.push($(this).val());
});
var count=$("#count").val();
$.ajax({
type: "POST",
url: 'reportr.php',
data: {
count:count,
pcheck:favorite,
tag : tag ,
type : type,
scheme : scheme
},
success: function() {
window.location.href = "reportr.php"; }
});
});
</script>
On alert the values are being displayed