嗨那里Iam创建一个PayPal IPN,我在我的购物车页面中有一个付款现在按钮,这是一个图像类型。我习惯使用类型提交。我只是想知道我将如何写入我的数据库的这个付款现在按钮的子。我的意思是我想写入数据库,因为这个按钮被点击,但我不知道如何做到这一点?这里是我的数据发送到贝宝的代码。如何将数据提交到我的数据库时,从我的购物车中点击paypal buynow按钮
<?php
if(isset($_SESSION['username']) && isset($_SESSION['itemnames']))
{
$checkoutbutton .='<form action="https://www.sandbox.paypal.com/cgibin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="xxxxxx">
<input type="hidden" name="upload" value="1">';
?> <ul2>
<?php
for ($i = 0;$i <count($_SESSION['itemnames']);$i++)
{ ?>
<li>
<?php
$x = $i + 1;
echo "<h3>";
echo $_SESSION['itemnames'][$i];
echo "</h3>";
echo "<b>Cost per Item: €" .$_SESSION['price'][$i] ."</br> Number of Items: " . $_SESSION['quantity'][$i] ."</b>";
$checkoutbutton .='<input type="hidden" name="item_name_'.$x.'" value="'. $_SESSION['itemnames'][$i] .'">
<input type="hidden" name="amount_'.$x.'" value="' .$_SESSION['price'][$i] . '">
<input type="hidden" name="quantity_'.$x.'" value="' .$_SESSION['quantity'][$i] . '">';
?>
</li>
<?php } $checkoutbutton .='<input type="hidden" name="notify_url" value="http://ipnscript.php">
<input type="hidden" name="return" value="http://ranscomplete.php">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="cbt" value="return to store">
<input type="hidden" name="cancel_return" value="http://www.theislandapp.com/transcancelled.php">
<input type="hidden" name="currency_code" value="EUR">
<input type="image" src="x-click-but5.gif" name="submit" alt="Make payments with PayPal - its fast, free and secure!">';
?>
</ul2>
<?php }
else {?>
<h2> No Items in cart </h2>
<?php } ?> </br></br>
你想要在你的数据库中存储什么? – 2012-03-22 18:51:36
病情进一步解释。通常我有一个输入类型提交被一个表单包围,我有形式方法作为职位,我使用if(isset($ _ POST ['submit'])){//我得到它做一些事情} – eoin 2012-03-22 18:54:38
哦,我没有在那里的数据库的东西,但只是想知道我怎么会发送到数据库,因为按钮被点击? – eoin 2012-03-22 18:55:44