我在这里有问题,我需要这$_SESSION['cart']
东西 里面的所有东西,并将它传递给jQuery使用它在一个php-ajax文件,我的问题是,如何做到这一点?
这就是我心目中
function myfunc()
{
//save cart to db of logged user
$("a.savecart").click(function(){
//how to assign the $_SESSION['cart'] into a js variable ?
$.ajax({
type: "POST",
url: "classes/ajax.cart.php",
data: //what to put here ?
success: function(data){
alert(data);
location.reload();
}
});
return false;
}
});
}
是的,这是一个关联数组.. ..但我怎么会在PHP的AJAX部分? – sasori
@sasori看我的编辑。 – xdazz
我的$ _SESSION [ '购物']包含这样'阵列 数据( [1] => 1 [6] => 1 ) 1' – sasori