I need to set value returned from jQuery Success function to the variable in PHP page.
$(document).ready(function(){
$('#form').submit(function(){
$.ajax({
url : 'test.php',
type : 'POST',
data : $('form').serialize(),
success: function(data){
$('#hiddenField').html(data);
}
<?php
$phpVariable = “hiddenfield value” --- returned from test.php
?>
Please note: I want the returned value in PHP variable only and on the same page. However I can set the value an hidden variable, but not able to get value and assign to PHP variable from an hidden field