I am trying to get data from one php page and pass it to another page using Ajax.
JS :
$.ajax({
url: \"action.php\",
succes
First of all, you need to echo
your data in action.php, and second, use data
parameter of AJAX request to send data to data.php.
Here's the reference:
So the organization of pages should be like this:
JS :
$.ajax({
url: "action.php",
success: function(data){
$.ajax({
url: "data.php",
data: {id: data},
success: function(data){
// your code
// alert(data);
}
});
}
});
action.php :
data.php :