Guys i want to pass an array (got from checkbox) with some other variable.
function some_function(user_id,add_remove_id,which_page) {
//getting the array
var allVals = [];
$('#friend_id_saf :checked').each(function() {
allVals.push($(this).val());
});
var type=3;
var data = 'user_id=' + user_id+'&add_remove_id='+add_remove_id+'&type='+type;
$.ajax({
type:"POST",
url:"add_rem_friend.php",
//*****************************************
// how should i send the data to php
data:data,{myarray:allVals},
//******************************************
success:function(html) {
if (which_page==='incoming-request') {
$('#'+add_remove_id).html(html);
} else if(which_page ==='profile-details') {
$('#div_status').html(html);
}
}
});
return false;
}
how should i send the array with other data?
data:data,{myarray:allVals},
please help me.