thats just part of my ajax - its the variable in the .php file.
Code:
echo json_encode($mystring);
The code in my .php file works - everything that side works apart from where you gave me:
Code:
$variable = array( newp => $newp, totalitem => $totalitem );
$mystring='';
foreach($variable as $val => $key){$mystring.=$key.';';}
echo json_encode($mystring);
It should be sending the array back to here to be used in the function(hp) - Ive done this fine with a single variable just not an array.
Code:
$.ajax({
type: 'POST',
url: 'store.php',
data: {
'function': 'hp',
'quantity': hpqty
},
dataType: 'json',
cache: false,
success: function(hp) {
// code to change my spans
}
Bookmarks