[insert_php]
$PayID=$_REQUEST[“PaymentID”];
$TransID=$_REQUEST[“TransID”];
$ResCode=$_REQUEST[“resultcode”];
$AutCode=$_REQUEST[“auth”];
$PosDate=$_REQUEST[“postdate”];
$TrckID=$_REQUEST[“TrckID”];
$UD1=$_REQUEST[“udf1”];
$UD2=$_REQUEST[“udf2”];
$UD3=$_REQUEST[“udf3”];
$UD4=$_REQUEST[“udf4”];
$UD5=$_REQUEST[“udf5”];
$RefCode = $_REQUEST[“ref”];
$Brand = $_REQUEST[“cardtype”];
$Protocol = $_REQUEST[“payinst”];
$Protection = $_REQUEST[“liability”];
$HostResponseCode = $_REQUEST[“responsecode”];
$Country = $_REQUEST[“cardcountry”];
$Ip = $_REQUEST[“ipcountry”];
$Mistake = $_REQUEST[“Error”];
$MistakeText = $_REQUEST[“ErrorText”];
if (strncmp($ResCode, “APPROVED”, 8) == 0 || strncmp($ResCode, “CAPTURED”, 8) == 0) {
$user=””;
$mysqli = new mysqli(“localhost”, “coastsub2”, “scroll1”, “coastsub2_reg”);
if (! $mysqli->connect_errno) {
$query = “select name from prereg where paymentid=\”$PayID\”; “;
if ($result = $mysqli->query($query)) {
$row = $result->fetch_row();
$user = $row[0];
$result->close();
}
$mysqli->close();
}
print(“
Thanks $user for registering!
\n”);
print(“
Please print this page with the following code for future reference:
\n”);
print(“
$PayID
\n”);
} else if (strncmp($ResCode, “NOT APPROVED”, 12) == 0 || strncmp($ResCode, “NOT CAPTURED”, 12) == 0){
print(“
Sorry, registration failed
\n”);
print(“
Response code: $ResCode
\n”);
print(“
\n”);
print(“$PayID
\n”);
} else if (strncmp($ResCode, “DENIED BY RISK”, 14) == 0 || strncmp($ResCode, “HOST TIMEOUT”, 12) == 0){
print(“
Sorry, registration failed
\n”);
print(“
Response code: $ResCode
\n”);
print(“
\n”);
print(“$PayID
\n”);
} else if (strncmp($ResCode, “PENDING”, 7) == 0){
print(“
Registration pending
\n”);
print(“
\n”);
print(“$PayID
\n”);
} else if (strlen($ResCode) == 0){
print(“
Sorry, registration failed
\n”);
$len = strlen($Mistake);
$errstr = substr($MistakeText,$len+1);
print(“
Response message: $errstr
\n”);
}
[/insert_php]