I am getting my form data in to a array with
var fields = $(this).serializeArray();
I want to push the dynamic token value to this array before I make ajax call to process this array in php.
I try with
fields.push({token:value});
my ajax call to php is
$.ajax({
type : 'POST',
url : "test.php",
data : fields,
dataType : 'json',
success: function(data) {......},
error{....}
});
In my test.php page I want to use that token value like
$token = $_POST[token];
but the $token value is null.