JQuery AJAX从返回的URL获取GET数据

时间:2015-03-11 11:58:09

标签: php jquery ajax

我正在制作支付系统。当用户付款并且付款成功时,返回的URL如下:

success.php?ORDER_NUMBER=123456&TIMESTAMP=1426074386&PAID=DBE92B3F3C&METHOD=1&RETURN_AUTHCODE=1DAD7FA700AEAD89C181EA94A322954F 

我有success.php文件,并在其中返回值。我正在徘徊如何在我的div中获取那些在另一个类中的值。

<div id="third_nav" style="display: none"><h1>Receipt</h1></div>

我的success.php类;

if ($module->confirmPayment($_GET["ORDER_NUMBER"], $_GET["TIMESTAMP"], $_GET["PAID"], $_GET["METHOD"], $_GET["RETURN_AUTHCODE"])) {
// Payment receipt is valid

$ORDER_NUMBER = mysql_real_escape_string($_GET['ORDER_NUMBER']);
$TIMESTAMP = mysql_real_escape_string($_GET['TIMESTAMP']);
$PAID = mysql_real_escape_string($_GET['PAID']);


date_default_timezone_set('Europe/Helsinki');
$dateTime = date("d/m/Y", $TIMESTAMP);

echo $PAID;
echo "<br/>";

echo $dateTime;
echo "<br/>";
echo $ORDER_NUMBER; 

echo "<br/>";

//$_SESSION['cart'] = "";
unset($_SESSION['cart']);
 }else {
   echo "Payment failed";
 }
  ?>

成功付款后,网址会从银行发送。提前致谢。 我的jQuery AJAX;

function paymentSuccess(){

    event.preventDefault();
    $("#third_nav").html('');
    var values = //Don´t know what to be here
    $.ajax({
        url: "success.php",
        type: "get",
        data: values,
        success: function(html){
             alert("success");
             $("#third_nav").html(html);
              },
              error:function(){
              $("#third_nav").html('There is error while submit');
                }
            });
        }

0 个答案:

没有答案