- " . $errmsg . "
An error has occurred within our database system
"; } } else { $ok=FALSE; $errmsg.="Error accessing our system
"; } } if ($ok) { $sql="select ID from tMember where vcUsername='" . $un . "';"; $result = mysql_query($sql) or die ("Could not get results: " . mysql_error()); $result1=mysql_num_rows($result); if ($result1>0) { $ok=FALSE; $errmsg.="This username is already in use
Please go back and choose another
We are unable to contact our credit card processor right now
Please retry in a few minutes
"; } else { $auth_status = explode(",", $result); // 0 - is 1,2,3 - approval // 5 is A,B,E,G... AVS error codes $rc=$auth_status[0]; $ac=$auth_status[4]; $tc=$auth_status[6]; switch ($rc) { case 1: $appr=1; break; case 2: $ok=FALSE; $appr=0; $errmsg.="Transaction status: card declined
"; case 3: $ok=FALSE; $appr=0; $errmsg.="Transaction declined
Error:
".$auth_status[3]; break; case 4: $ok=FALSE; $appr=0; $errmsg.="
Gateway holding this transaction for review
"; break; default: $appr=0; $ok=FALSE; $errmsg.="Transaction response error - please see Authorize.net information
".$auth_status[3]; } //$errmsg.="
Entire response:
".$result;
}
}
}
if ($ok) {
$sql="INSERT INTO tMember " .
"(vcUsername,vcPassword,vcEmail,dSignup,vcFName,vcLName,vcAddress,vcCity,vcState,vcZIP,vcCountry," .
"dExpiration ,vcTransID,vcAuthCode,iStatus,iPmtPlan) " .
"VALUES ('" .
$un . "','" .
$pw . "','" .
$em .
"',CURDATE(),'" .
$fn . "','" .
$ln . "','" .
$addr . "','" .
$city . "','" .
$stt . "','" .
$zip . "','" .
$co . "',DATE_ADD(CURDATE(),".$sqldays."),'" .
$tc . "','" .
$ac . "',1,".$plan.");";
$result = mysql_query($sql) or die ("Error not enter information: " . mysql_error() . "
" . $sql);
$id=mysql_insert_id();
if ($id!=0) {
$sql="INSERT INTO tPmt_cc (iMemberID,dDate,dPerEnd,mAmt,vcFName,vcLName,vcAuthCode,vcTransID,iStatus) " .
"VALUES (" .
$id .
",CURDATE(),DATE_ADD(CURDATE(),".$sqldays."),'" .
$amt .
"','" . $fn .
"','" . $ln .
"','" . $ac .
"','" . $tc .
"'," . $rc . ");";
$result = mysql_query($sql) or die ("P - Error not enter information: " . mysql_error()."
".$sql); } else { $ok=FALSE; $errmsg.="
Error entering payment information
"; } } echo "Join Krivs Studio
"; if ($ok) { echo "Signup Completed
Your membership has been processed. You may keep this information for your records:
- ";
echo "
- Username: " . $un . " "; echo "
- ID Number: " . $id . " "; echo "
- Authorization Code: " . $ac . " "; echo "
- Transaction ID: " . $tc . "
Transaction Error
"; echo "
Your signup could not be processed because the following error(s) occurred:
" . $errmsg; echo ""; } ?>