【发布时间】:2023-03-16 09:47:01
【问题描述】:
大家好,我只需要制作一个简单的页面。并且需要练习我们如何在我们的网站中集成支付宝并使用它。但我不知道将我重定向到 400 错误页面的问题是什么。这是我的代码。
<table class="right" >
<?php
while($row = $results->fetch_assoc()){
?>
<tr>
<td class="image-container"><img src="images/<?php echo $row['image']; ?>" class = "image"/></td>
<td><h3 class="Product-Name">name: <?php echo $row['name'];?></h3> <h4>Price <?php echo $row['price']; ?></h4></td>
<td>
<input type="hidden" name="cmd" value="_ext-enter">
<form name = "subs" action = "https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="business" value="mona22-merchant@softgetix.com">
<input type="hidden" name="amount" value = <?php echo $row['price'] ?> id="paypalamt">
<input type="hidden" name="item_name" value = <?php echo $row['name']?> id = "name" >
<input type="image" src="../images/mobile2.jpg" border="0" name = "submit">
</form>
</td>
</tr>
<?php }?>
</table>
【问题讨论】:
-
您正在为带有循环的元素生成
ids,因此您将拥有多个具有相同ids 的元素,这现在可能不会导致问题,但将来可能会出现问题。我建议您在解决当前问题后立即解决此问题。