function submitID(){
// some codes working in here....
var text="A_1";
var name="test";
$.ajax({
url: 'callmethod.php',
type: 'post',
data: {'action':'methodname', 'text': text, 'name':name},
success: function(data, status) {
var results = JSON.parse(data);
for(var i = 0; i < results.length; i++){
var id= results[i]['ID'];
alert(id); --- I got the value of ID in here -- example output value : Hello
}
},
error: function(xhr, desc, err) {
console.log(xhr);
console.log("Details: " + desc + "\nError:" + err);
}
});
}
What I would like to do in here, I got the value of var id but I want to set as the PHP variable $valuephp= >>> id <<< how can I do for that? please help me to advice.