So, im using $.tableDnD.serialize() function, to get the current order of the Table TR-s, and want to post to a php function alongside with another variable.
$("#articlestable").tableDnD({
onDragClass: "drag",
onDrop: function(table, row) {
$.post('<?php echo HTML_ROOT; ?>/admin/cikkek/updateOrder/', {
pagesid : "1",
arr : $.tableDnD.serialize()
});
}
});
If i am sending the serialized data only, there is no problem with the access. According to firebug the sent data:
arr articlestable[]=1&articlestable[]=2&articlestable[]=4&articlestable[]=3
pagesid 1
The main question, how can i get the data in php? I thought:
$pagesid = $_POST["pagesid"];
$orderarr = $_POST["arr"]["articlestable"];
Thanks for help, and sorry for my english.
I think what you want to do is parse string. I could be wrong.
<?php
$arr = array();
$str = $_POST['arr'];
parse_str($str, $arr);
?>
In doing this, you should be able to then access the array as ->
echo $arr[0]; // outputs 1
echo $arr[1]; //outputs 2
echo $arr[2]; //outputs 4
So on and so forth.
EDIT
I should also note that using this method, you can still access your pageid by using the following:
echo $arr['pagesid'];