<?php include_once '../lib/glob.php'; include_once '../lib/lib.php'; if (!isset($_POST["cart_row_0"]) or !isset($_SESSION["id"])) { die("ERROR ON PAGE!"); } else { $cartObj3 = new cartDisplayer($_SESSION["id"]); $arr = array(); //check security for ($i = 0; $i < count($cartObj3->itemArr); $i++) { $arr[$i] = checkQTY3($_POST["pid_{$i}"], $_POST["cart_row_{$i}"]); if (!lib_int_validate($_POST["cart_row_{$i}"])) { die("ERROR ON PAGE"); } } for ($row = 0; $row < count($arr); $row++) { $cartObj3->changeItemQuantity($row, $arr[$row]); } setAlertMsg("更改已被保存!"); header("Location:../cart.php"); }
$res = curl_exec($ch); curl_close($ch); // assign posted variables to local variables $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; $user_custom = $_POST['custom']; if (isset($user_custom)) { //&&lib_int_validate($user_custom) $id = mysql_real_escape_string($user_custom); $obj = new cartDisplayer($id); $obj2 = new lib_giftPoint($id); } if (strcmp($res, "VERIFIED") == 0) { // check the payment_status is Completed // check that txn_id has not been previously processed // check that receiver_email is your Primary PayPal email // check that payment_amount/payment_currency are correct // process payment if ($payment_status == 'Completed') { $query = "SELECT 'txn_id' FROM shop_ipn WHERE txn_id ='" . $txn_id . "'"; $result = mysql_query($query); if (mysql_num_rows($result) == 0) { if ($receiver_email == '*****@*****.**') { $totalcost = $obj->getCostTotal(); $shipcost = getShippingCost($obj->getItemTotal());
height:36px; border:0; font-size:20px; font-weight:bold; background:url('images/save_btn.jpg'); } .paypal_btn{ margin-top:20px; } </style> <script text="javascript" src="js/cart_input_validate.js"></script> <script type="text/javascript" src="js/submit_order.js"></script> <?php if (isset($_SESSION["id"])) { $cartObj2 = new cartDisplayer($_SESSION["id"]); } ?> <div class="cart_content"> <div class="cart_head"><span class="title_icon"><img src="images/cart.jpg" width="24" height="24" alt="" title="" /></span>我的購物車</div> <div class="feat_prod_box_details"> <form method="POST" action="process/prcs.change_cart_quantity.php"> <table class="cart_table"> <tr> <td><table class="cart_table"> <tr class="cart_title"> <?php if (!isset($_SESSION["id"])) { echo '<td colspan="6"><span class="red">請 <a href="login.php">登錄</a> 後才能訪問到您的購物車.</span></td>';
<?php if (isset($_SESSION["id"])) { $cartObj = new cartDisplayer($_SESSION["id"]); $quantity = $cartObj->getItemTotal(); $costTotal = $cartObj->getCostTotal(); } else { $quantity = 0; $costTotal = 0; } ?> <div class="right_content"> <div class="cart"> <div class="title"><span class="title_icon"><img src="images/cart.gif" alt="" title="" /></span>My cart</div> <div class="home_cart_content"> <?php echo $quantity; ?> x items | <span class="red">TOTAL: $<?php echo $costTotal; ?> </span> </div> <a href="cart.php" class="view_cart">view cart</a> </div>