PHP Ajax Sending Array

Viewed 67

I'm sending an array to a PHP file named update.php and in all previous versions of this script it's worked, but for some bizarre reason it isn't working in this instance.

Here are the files:

var phpLocation = '/admin/_backend' + $( this ).attr("action"),
    usergroup = $('input:hidden[name="usergroup"]').val(),
    serializedData = $('input:checkbox[name="permission"]:checked').map(function () {
                         return this.value;
                      }).get();

var ajaxData = {'usergroup_permissions': serializedData, 'usergroup' : usergroup};

$.ajax({
    type: "POST",
    url: phpLocation,
    data: ajaxData,
    success: function(data){
        $("#post_reply").html(data);

        console.log( ajaxData );
    }
});

When attempting to grab and turn usergroup_permissions from an array into a list separated by commas, it doesn't seem to work.

Even when using $_POST['usergroup_permissons'] it doesn't seem to work..

$permission_list = implode(",", $_POST['usergroup_permissions']);

Edit
This is the console.log output
enter image description here

print_r( $_POST ); returns:

enter image description here

1 Answers
Related