是否可以?!为 paypal 动态下拉菜单项指定动态名称
我有一个下拉菜单,它是从我的数据库中填充的。在填充列表后,我必须为每个 option_select 和 option_amount 提供一个条目,但它需要链接到该列表。有没有一种方法可以为每个选项提供一些将传递到 paypal 的信息,因为目前传递到 paypal 购物车的唯一信息是 "PHOTOID & "
但我无法让它发送所选的产品!啊啊!!请帮忙! 这是我的代码:
<form target="_self" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="MYEMAILADDRESS" />
<input type="hidden" name="cancel_return" value="website/cancel">
<!-- Specify an Add to Cart button. -->
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="PHOTOID<?php echo $pid;?> <?php echo $product;?>" />
<input type="hidden" name="currency_code" value="GBP" />
<!-- Provide a dropdown menu option field with prices. -->
<!--<input type="hidden" name="on1" value="Size" />-->
<select name="os1">
<option value="Delivery Destination">-- Select --</option>
<?php
$i = 0;?>
<?php $prices=MYSQL_QUERY( "select * from FESTpricelist");
while($pricelist=mysql_fetch_array( $prices ))
{
$id = "".$pricelist['id']."";
$product = "".$pricelist['product']."";
$price = "".$pricelist['price']."";
?>
<option value="<?php echo $product;?>"><?php echo $product;?> £<?php echo $price;?> </option>
<?php } ?>
</select>
<br />
<!-- Specify the price that PayPal uses for each option. -->
<input type="hidden" name="option_index" value="1" />
<?php
$i = 0;?>
<?php $prices=MYSQL_QUERY( "select * from FESTpricelist");
while($pricelist=mysql_fetch_array( $prices ))
{
$id = "".$pricelist['id']."";
$product = "".$pricelist['product']."";
$price = "".$pricelist['price']."";
?>
<input type="hidden" name="option_select<?php echo $i;?>" value="<?php echo $product;?>" />
<input type="hidden" name="option_amount<?php echo $i;?>" value="<?php echo $price; ?>" />
<?php $i = $i + 1;
} ?>
<!-- specify shipping cost -->
<input type="hidden" name="shipping1" value="0" />
<!-- Display the payment button.
<input type="image" name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_cart_LG.gif" alt="PayPal - The safer, easier way to pay online" />-->
<input type="image" src="images/1301261203_edit_add.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="paypal" border="0" width="1" height="1" src="https://www.paypal.com/en_US/i/scr/pixel.gif">
</form>
I have a drop downmenu which is populated from my database. I have to give each option_select and option_amount an entry after the list has been populated but it needs to link to the list. Is there a way I can give each option a bit of information that will be passed through to paypal because at the moment the only information being passed to the paypal cart is "PHOTOID & <?$ID?>"
but I can't get it to send the Product that is selected! arrrghh!! Please help!
Here is my code:
<form target="_self" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="MYEMAILADDRESS" />
<input type="hidden" name="cancel_return" value="website/cancel">
<!-- Specify an Add to Cart button. -->
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="PHOTOID<?php echo $pid;?> <?php echo $product;?>" />
<input type="hidden" name="currency_code" value="GBP" />
<!-- Provide a dropdown menu option field with prices. -->
<!--<input type="hidden" name="on1" value="Size" />-->
<select name="os1">
<option value="Delivery Destination">-- Select --</option>
<?php
$i = 0;?>
<?php $prices=MYSQL_QUERY( "select * from FESTpricelist");
while($pricelist=mysql_fetch_array( $prices ))
{
$id = "".$pricelist['id']."";
$product = "".$pricelist['product']."";
$price = "".$pricelist['price']."";
?>
<option value="<?php echo $product;?>"><?php echo $product;?> £<?php echo $price;?> </option>
<?php } ?>
</select>
<br />
<!-- Specify the price that PayPal uses for each option. -->
<input type="hidden" name="option_index" value="1" />
<?php
$i = 0;?>
<?php $prices=MYSQL_QUERY( "select * from FESTpricelist");
while($pricelist=mysql_fetch_array( $prices ))
{
$id = "".$pricelist['id']."";
$product = "".$pricelist['product']."";
$price = "".$pricelist['price']."";
?>
<input type="hidden" name="option_select<?php echo $i;?>" value="<?php echo $product;?>" />
<input type="hidden" name="option_amount<?php echo $i;?>" value="<?php echo $price; ?>" />
<?php $i = $i + 1;
} ?>
<!-- specify shipping cost -->
<input type="hidden" name="shipping1" value="0" />
<!-- Display the payment button.
<input type="image" name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_cart_LG.gif" alt="PayPal - The safer, easier way to pay online" />-->
<input type="image" src="images/1301261203_edit_add.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="paypal" border="0" width="1" height="1" src="https://www.paypal.com/en_US/i/scr/pixel.gif">
</form>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我明白了!!! :)
I'VE GOT IT!!! :)