2014-05-03 9 views
0

我正在將CCAvenue整合到以PHP開發的在線電影預訂網站中。我需要在成功付款後將特定值(例如劇院名稱,電影名稱,座位號碼等)帶到重定向頁面,因爲票據生成需要數據。我在ccavenue的Checkout.php頁面中使用下面的代碼,但不會執行這些值。請幫忙。CCAvenue重定向後無法在成功頁面上攜帶特定值

<html> 
<head> 
<title> Checkout</title> 
</head> 
<body> 
<center> 
<?php include('adler32.php')?> 
<?php include('Aes.php')?> 
<?php 

error_reporting(0); 

$merchant_id="xxxxxxxx"; // Merchant id(also User_Id) 
$amount="1";   // your script should substitute the amount here in the quotes provided here 
$order_id=uniqid();  //your script should substitute the order description here in the quotes provided here 
$url="xxx.com/files/redirecturl.php";   //your redirect URL where your customer will be redirected after authorisation from CCAvenue 
$billing_cust_name=$_POST['uname']; 
$billing_cust_address=$_REQUEST['location']; 
$billing_cust_tel=$_POST['mobno']; 
$billing_cust_email=$_POST['email']; 

$date=$_REQUEST['date']; 
$seatno=$_REQUEST['seatno']; 
$moviename=$_REQUEST['moviename']; 
$theatre=$_REQUEST['theatre']; 
$cost=$_REQUEST['cost']; 



$working_key='xxxxxxxx'; //Put in the 32 bit alphanumeric key in the quotes provided here. 


$checksum=getchecksum($merchant_id,$amount,$order_id,$url,$working_key); // Method to generate checksum 

$merchant_data= 'Merchant_Id='.$merchant_id.'&Amount='.$amount.'&Order_Id='.$order_id.'&Redirect_Url='.$url.'&billing_cust_name='.$billing_cust_name.'&billing_cust_address='.$billing_cust_address.'&billing_cust_tel='.$billing_cust_tel.'&billing_cust_email='.$billing_cust_email.'&Checksum='.$checksum; // This value is carried forward to to the redirecturl.php page 

$user_data='date='.$date.'&moviename='.$moviename.'&theatre='.$theatre.'&cost='.$cost; // This value is not carried forward to the redirecturl.php page 


$encrypted_data=encrypt($merchant_data,$working_key); // Method for encrypting the data. 

?> 

<form method="post" name="redirect" action="http://www.ccavenue.com/shopzone/cc_details.jsp"> 
<?php 
echo "<input type=hidden name=encRequest value=$encrypted_data>"; 
echo "<input type=hidden name=Merchant_Id value=$merchant_id>"; 
echo "<input type=hidden name=user_data value=$user_data>"; 
?> 
</form> 

</center> 
<script language='javascript'>document.redirect.submit();</script> 
</body> 
</html> 
+0

你可以把你的代碼的餘下的一些行 – adi

+0

嗨,阿迪,我用完整的代碼編輯了問題。 – DeepankarSaha

+0

你試過回顯$ _REQUEST數組值嗎?嘗試檢查提交的值是否已提交,或者在提交表單後不打印$ _REQUEST – adi

回答