我开发了一个购物车。客户选择项目,“display.htm”页面显示项目名称、总数量和他必须支付的总付款。所以我想知道当客户点击“点击这里付款”按钮时,如何让他通过 PayPal 付款。
display.html:
<body>
<body onLoad="getDoc()">
<div id="display"> </div>
</body>
display.php:
<?php
$xml = new DOMDocument;
$xml->load("cart.xml");
$book = $xml->getElementsByTagName("book");
echo "<table border=1><tr><th>Title</th><th>Quantity</th><th>Total Price</th></tr>";
$total_pay=0;
foreach($book as $node)
{
$title = $node->getElementsByTagName("title");
$title = $title->item(0)->nodeValue;
$quantity = $node->getElementsByTagName("quantity");
$quantity = $quantity->item(0)->nodeValue;
$totalprice = $node->getElementsByTagName("totalprice");
$totalprice = $totalprice->item(0)->nodeValue;
$total_pay=$total_pay+$totalprice;
echo" <tr><td>{$title}</td><td>{$quantity}</td><td>{$totalprice}</td></tr>";
}
echo "</table>";
echo "<br />";
echo "Your total payment is: $total_pay <br/>";
echo "<form><input type='button' name='submit' value='Click Here to Proceed For Payment' onClick='window.location.href= '/></form>";
?>