自定义paypal签出,包括php变量

自定义paypal签出,包括php变量,php,html,input,paypal,Php,Html,Input,Paypal,我正在尝试添加一个“自定义”值到第三方结帐贝宝选项。我遇到的问题是PHP变量正在屏幕上显示。我正在会话变量中传递购物车值 if(isset($_SESSION['checkout'])){ $orderData = '<table border="1"><th style="width:80px">Item</th> <th sytle="width:250px">Size</th>

我正在尝试添加一个“自定义”值到第三方结帐贝宝选项。我遇到的问题是PHP变量正在屏幕上显示。我正在会话变量中传递购物车值

if(isset($_SESSION['checkout'])){
$orderData = '<table border="1"><th style="width:80px">Item</th>
             <th sytle="width:250px">Size</th>
             <th style="width:60px">Quantity</th>';
for ($i=0; $i<count($_SESSION['checkout']); $i++){
    $orderData .= '<tr><td style="text-align:center">'.$_SESSION['checkout'][$i][0].'</td><td style="text-align:center">'.$_SESSION['checkout'][$i][1].'</td><td style="text-align:center">'.$_SESSION['checkout'][$i][2].'</td></tr>';
}
}
if(isset($\u会话['checkout'])){
$orderData='项
大小
数量';

对于($i=0;$i它显示在PayPal按钮之前是什么意思?如果您正在查看页面的源代码,您将在页面中看到值


如果你说你正在传递金额,但没有看到它,你可能使用了错误的变量。变量金额是一个有效的PayPal变量,但取决于你具体使用的按钮,金额变量be略有不同。我无法从你的代码中分辨,因为我没有看到你传递给“cmd”的是什么,但如果您使用的是“立即购买”按钮或“添加到购物车”按钮,则变量“amount”将是正确的变量。如果您使用购物车上载方法,则您希望使用变量“amount_x”。因此,如果我传递了两个项目,第一个是0.99,第二个是1.99,我将传递变量/值“金额1=0.99”和“金额2=1.99”".

嘿,问题不在于金额,而在于自定义输入字段。我的意思是,值显示在屏幕上,就像它没有隐藏一样。名为custom和值$orderData的输入没有隐藏,而是显示在屏幕上……而且,我将整个购物车值发送给PayPal,而不是单个项目。自定义变量不应该显示在屏幕上。你能提供你看到的屏幕截图,并链接到你的结帐,这样我就可以走过去,看看可能是什么导致了问题。我用完整的代码和图像更新了我的帖子。希望你仍然关注这篇帖子,即使我错过了几天这里。。。
echo '<form>
      //other hidden values
      <input type="hidden" name="custom" value="'.$orderData.'">
      //input submit button here
      </form>
<input type="hidden" name="amount" value="';?><?php if(isset($_SESSION['disc'])){print_r($_SESSION['disc']);}?><?php echo '">
echo '<div style="position:absolute; left:770px; top:50px">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="myemail@example.com">
<input type="hidden" name="item_name" value="Merchandise">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="custom" value="'.$orderData.'">
<input type="hidden" name="return" value="backtomywebsite.com">
<input type="hidden" name="cancel_return" value="backtomywebsite.com">
<input type="hidden" name="amount" value="';?><?php if(isset($_SESSION[$disc])){print_r($_SESSION[$disc]);}?><?php echo '">
<input type="image" src="http://www.mywebsite.com/images/BuyNow.png" name="submit" alt="Make payments with PayPal - it\'s fast, free and secure!" width="300" height="204">
    </form>
    </div>';