The Problem
I am tring to do an ajax request to a PHP script, however I am having a problem getting the data into the format that the PHP is expecting it, the PHP is expecting the data to come in as array within an array something like,
Array
(
[cv_file] => Array
(
[849649717] => Y
[849649810] => Y
)
[save] => Save CVs
)
What have I tried?
Ben, boş bir dizi oluşturmak ve dizi tuşu, böyle bir şey olarak kullanmak benim javascript denedi
var cv_file = new Array();
$(".drag_check").draggable({helper:"clone", opacity:"0.5"});
$(".searchPage").droppable({
accept:".drag_check",
hoverClass: "dropHover",
drop: function(ev, ui) {
var droppedItem = ui.draggable.children();
cv_file = ui.draggable.children().attr('name');
var link = ui.draggable.children().attr('name').substr(ui.draggable.children().attr('name').indexOf("[")+1, ui.draggable.children().attr('name').lastIndexOf("]")-8)
$.ajax({
type:"POST",
url:"/search",
data:cv_file+"&save=Save CVs",
success:function(){
alert(cv_file)
$('.shortList').append('<li><input type="checkbox" value="Y" class="checkbox" name="remove_cv['+link+']"/><a href="/cv/'+link+'">'+link+'</a></li>');
},
error:function() {
alert("Somthing has gone wrong");
}
});
}
});
My Question
Nasıl PHP bekliyor biçime veri alabilirsiniz, ben herkesin verebileceği herhangi bir yardım takdir ediyorum?
Edit
On alerting what the poster in the comments suggested I get he following,
cv_file[849649717]&save=Save CVs
Teşekkür ederim