Mam taki kod:
<? require_once ('../connection.php'); connection(); $upgrade = $_GET["upgrade"]; $username = $_GET["username"]; $price = $_GET["price"]; //formularz { $zapytanie = "INSERT INTO test_buyprem ( id, amount, nick, date) VALUES (' ', '$upgrade', '$username', '$date')"; } ?>
<!DOCTYPE HTML> <html> <head> <link rel="stylesheet" type="text/css" media="all" href="https://refbackbank.com/adm/niceforms-default.css" /> <style type="text/css"> p { font-family: "Trebuchet MS", Arial, sans-serif; font-size: 10pt; } h3 { font-family: "Trebuchet MS", Arial, sans-serif; color: #666; } </style> </head> <body> <h3>Dear <?if($_SESSION['login']) { echo $username; ?>,</h3> <br /> <form action="https://www.paypal.com/cgi-bin/webscr" method="POST" target="_top" style="display:inline;"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="adrianos1992@gmail.com"> <input type="hidden" name="lc" value="US"> <input type="hidden" name="item_name" value="<?=$upgrade;?> - <?=$username;?>"> <input type="hidden" name="amount" value="<?=$price;?>.00"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="button_subtype" value="services"> <input type="hidden" name="no_note" value="0"> <input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHostedGuest"> <input type="image" src="https://refbackbank.com/images/paypal.jpg" border="0" name="submit" id="submit" value="submit" alt="PayPal - The safer, easier way to pay online!"> </form> <form method="post" action="https://www.alertpay.com/PayProcess.aspx" target="_top" style="display:inline;"> <input type="hidden" name="ap_merchant" value="money@refbackbank.com"/> <input type="hidden" name="ap_purchasetype" value="service"/> <input type="hidden" name="ap_itemname" value="<?=$upgrade;?> - <?=$username;?>"/> <input type="hidden" name="ap_amount" value="<?=$price;?>"/> <input type="hidden" name="ap_currency" value="USD"/> <input type="image" src="https://refbackbank.com/images/alertpay.jpg"/> </form> <form action="https://sci.libertyreserve.com/en" method="GET" target="_top" style="display:inline;"> <input type="hidden" name="lr_acc" value="U8279191"> <input type="hidden" name="lr_amnt" value="<?=$price;?>.00"> <input type="hidden" name="lr_currency" value="LRUSD"> <input type="hidden" name="lr_comments" value="<?=$upgrade;?> - <?=$username;?>"> <input type="hidden" name="lr_success_url" value="https://www.refbackbank.com/successfully/"> <input type="hidden" name="lr_success_url_method" value="GET"> <input type="hidden" name="lr_fail_url" value="https://www.refbackbank.com/fail/"> <input type="hidden" name="lr_fail_url_method" value="GET"> <input type="hidden" name="test" value="pass"> </form> </div> <? } else { ?> Guest, </h3> <? } ?> </body> </html>
Wszelka funkcjonalność związana z płatnościami działa, ale nie działa dodawanie do bazy. Podobnej konstrukcji tj:
{ $zapytanie = "INSERT INTO test_buyprem ( id, amount, nick, date) VALUES (' ', '$upgrade', '$username', '$date')"; }
Używam w innej części serwisu i tam działa bez problemu, ale tutaj niestety nie chce.
Czy dzieje się tak dlatego, że wartości przekazywane do bazy mają inne nazwy niż pola w tabeli, czy może dlatego że użyłem $GET zamiast $POST?