I'm currently using an ajax post to retrieve data from another page. For reusing the returned value in future, I want to assign it to a php variable. Is it possible?
success: function(data) {
$('#display').html(data);
}
I'm currently using an ajax post to retrieve data from another page. For reusing the returned value in future, I want to assign it to a php variable. Is it possible?
success: function(data) {
$('#display').html(data);
}
You can't. The php file completes its execution in the server first and the result is passed to the browser. The javascript (ie, ajax) part is then executed in your browser. Read the answer here for more info.