php贝宝签出多个项目

php贝宝签出多个项目,php,html,paypal,paypal-sandbox,Php,Html,Paypal,Paypal Sandbox,我写了一个简单的购物车,现在我想集成贝宝 这是我的Paypal代码(顶部=不带$counter,底部带$counter): echo”“; 回声“; 回声“; 回声“; foreach(会话::get('p_name')作为$items) { echo$项目; echo$计数器; 回声“; 回声“; 回声“; 回声“; $counter++; } 我想为“$items”(值为:Item1,Item2)中的每个值在Paypal中写一行 用我的Paypal代码和$counter,他说:“你的购

我写了一个简单的购物车,现在我想集成贝宝

这是我的Paypal代码(顶部=不带$counter,底部带$counter):

echo”“;
回声“;
回声“;
回声“;

foreach(会话::get('p_name')作为$items)
{
echo$项目;
echo$计数器;
回声“;
回声“;
回声“;
回声“;
$counter++;
}
我想为“$items”(值为:Item1,Item2)中的每个值在Paypal中写一行

用我的Paypal代码和$counter,他说:“你的购物车是空的”。
我应该换什么

“amount\u 1”应该是动态的“amount\u.$counter”。amount\u 2(和第二个项目名称)不再需要了。我更改了amount\u并删除了第二个项目名称和金额,但他仍然说:“您的购物车是空的。”将输入类型“text”从“hidden”更改为“text”,然后只需查看表单即可。表单中的值是否正确显示?如果“type=text”,他会正确显示值
        echo "<input type='hidden' name='item_name_1' value='$items'>";
        echo "<input type='hidden' name='amount_1' value='1.00'>";
        echo "<input type='hidden' name='item_name_2' value='$items'>";
        echo "<input type='hidden' name='amount_2' value='2.00'>";
     foreach(Session::get('p_name') as $items) 
     {
      echo $items;
      echo $counter;
      echo "<input type='hidden' name='item_name_.$counter.' value='$items'>";
      echo "<input type='hidden' name='amount_1' value='1.00'>";
      echo "<input type='hidden' name='item_name_.$counter.' value='$items'>";
      echo "<input type='hidden' name='amount_2' value='2.00'>";

    $counter++;
    }