안녕하세요, 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>
정확히 DB에 저장 하시겠습니까? –
아 설명. 일반적으로 나는 폼으로 둘러싸인 입력 타입을 가지고 있고 폼 메소드를 가지고 있고 ifetet ($ _ POST [ 'submit'])) {// 나는 뭔가를 얻는다.} – eoin
오 거기에있는 DB 물건은 아직 버튼을 클릭 할 때 db로 보내는 방법에 대해 궁금한가요? – eoin