easebuzzResponse($_POST); if ($result) { $result_json = json_decode($result); $status = $result_json->data->status; $payment_id = $result_json->data->easepayid; $order_id = $result_json->data->txnid; $form_id= $result_json->data->udf1; $table_id = $result_json->data->udf2; if ($status == 'success') { $sql = " UPDATE ".$table_id." SET payment_id = '".$payment_id."', order_id = '".$order_id."', payment_status = 'Paid' WHERE id = '".$form_id."' "; $result = $conn->query($sql); if ($result) { $_SESSION['table_id'] = $table_id; $_SESSION['form_id'] = $form_id; $_SESSION['order_id'] = $order_id; header("Location: ./success.php"); } else { header("Location: ./index.php"); } } else { #include_once('client-email.php'); echo 'Payment Failed Back to Main Page'; } } ?>