query($get_data); if (mysqli_num_rows($result) > 0) { // output data of each row while($row = mysqli_fetch_assoc($result)) { // var_dump($row); $working_key = $row['fmid']; $access_code = $row['fkey']; $website = $row['fwebsite']; $returnurl = $row['freturnurl']; } } $workingKey = $working_key; //Working Key should be provided here. $encResponse = $_POST["encResp"]; //This is the response sent by the CCAvenue Server $rcvdString = decrypt($encResponse,$workingKey); //Crypto Decryption used as per the specified working key. $order_status = ""; $decryptValues = explode('&', $rcvdString); $dataSize = sizeof($decryptValues); echo "
"; for($i = 0; $i < $dataSize; $i++) { $information=explode('=',$decryptValues[$i]); $response[$information[0]] = $information[1]; } if($response['order_status']==="Success") { $productinfo = $response['merchant_param3']; $txnid = $response['tracking_id']; $amt = $response['amount']; $firstname = 'HDFC'; $status = 'success'; $html = ""; echo "

Thank You. Your order status is success

"; echo "

Your Transaction ID for this transaction is ".$txnid.".

"; echo "

We have received a payment of Rs. " . $amt ."

"; $html="
Click here to take a PrintOut
"; echo $html; $html = ""; $update="update res_stud set FPAYMENTREMARKS='{$txnid}',FPAYMENTSTATUS='{$status}', FPAYMENTCONFIRM='{$status}', fackdate = current_date(), funivrecdate = current_date(), fackuser = '{$firstname}', FCHALLANNO = '{$txnid}' where APPNO='{$productinfo}'"; $result=$conn->query($update); //echo "
Thank you for shopping with us. Your credit card has been charged and your transaction is successful. We will be shipping your order to you soon."; } else if($order_status==="Aborted") { echo "
Thank you for shopping with us.We will keep you posted regarding the status of your order through e-mail"; } else if($order_status==="Failure") { echo "
Thank you for shopping with us.However,the transaction has been declined."; } else { echo "
Security Error. Illegal access detected"; } echo "

"; echo ""; // for($i = 0; $i < $dataSize; $i++) // { // $information=explode('=',$decryptValues[$i]); // echo ''; // } echo "
'.$information[0].''.urldecode($information[1]).'

"; echo "
"; ?>