$DECRYPToutfile"; # attempt to decrypt the message exec($DECRYPTcommand); # grab results from the temp file $fd = fopen($DECRYPToutfile, "r"); while ($buffer = fgets($fd, 4096)) { # echo $buffer; if (!$ccres) $ccres = $buffer; else $ccres .= $buffer; } # echo $ccres; fclose($fd); # delete temp files unlink($DECRYPTinfile); unlink($DECRYPToutfile); parse_str($ccres); #$response=ereg_replace("session-key","sessionkey",$response); $POP = ereg_replace("pop.auth-code","authcode",$POP); $POP = ereg_replace("pop.avs-code","avscode",$POP); $POP = ereg_replace("pop.ref-code","refcode",$POP); $POP = ereg_replace("pop.action-code","actcode",$POP); parse_str($POP); # This checks to see if it's approved or what. You can also add your # AVS check here. if ($MStatus == "success" OR $MStatus == "success-duplicate"): # Tell it what to do here if it authorizes. This just forwards to a thank you message. Header("Location: ./complete.html"); else: # If authrization fails, redirect to another page. Send the error codes with it # for intepretation. Header("Location: ./error.html?errorcode=$MErrCode&avs=$avscode"); endif; ?>