A: 

Do you mean

$.ajax({
    type: "POST",
    url: "server_items_reorder.php",
    data: {'positions':positions, 'wb_name': wb_name}
});

?

Felix Kling
A: 

You need to mix your PHP inline with your AJAX request:

$('.ui-icon-closethick').click(function(e) {
    e.preventDefault();
    var parent = $(this).parent().parent();
    $.ajax({
        type: "POST",
        url: "server_items_reorder.php",
        data: 'id=' + parent.attr('id') + '&php_var=<?php echo $php_var; ?>',
        success: function() {
            parent.slideUp(300,function() {
                parent.remove();
            });
        }
    });
});

And for your second example:

function savelayout(){
    var positions = "";
    var weight = 0;
    var wb_name = "<?php echo $wb_name; ?>";
    $(".portlet").each(function(){
        weight++;
        positions += (this.id + "=" + this.parentNode.id + "|" + weight + "&");
    });

    $.ajax({
        type: "POST",
        url: "server_items_reorder.php",
        data: positions
    });
}
cballou
A: 
wHiTeHaT