0
  vars["price"] = $('#awp_p_impact').val(); //here I will add plus the calculation of the heigh..
        vars["test"] = 100;
        vars["weight"] = $('#awp_p_weight').val();
        vars["quantity"] = $('#quantity_wanted').val();
        vars["quantity_available"] = $('#quantityAvailable').length?$('#quantityAvailable').html():awp_quantity;
        vars["id_product"] = $('#product_page_product_id').val();
        vars["awp_isie"] = ($.browser.msie?"1":"0");
        vars["allow_oos"] = allowBuyWhenOutOfStock?"1":"";

$.ajax({
        type: 'POST',
        url: baseDir + 'modules/attributewizardpro/combination_json.php',
        async: false,
        cache: false,
        dataType : "json",
        data: vars,

如何获取/调用 combination_json.php 中的 vars["test"] ?

4

1 回答 1

2

当您通过 Ajax(一个包含属性的对象)发布数据时,所有这些内容都将在$_POSTPHP 脚本的全局变量中找到。

您可以通过(例如)访问它们:

$test = $_POST['test'];

// $test should contain "100"
于 2013-04-16T23:26:59.960 回答