Okay, I have this code:
<?
//Code returned
$AVSCode="Y:3585460f5bc4f800:YNYM:093250860081744XF3LW 01:";
$Address=substr($AVSCode,19,1);
$ZipCode=substr($AVSCode,20,1);
$CVM=substr($AVSCode,22,1);
if ($Address != "Y"){
$error.="The Address provided does not match the information on file with your card issuer.<br>\n";
}
if ($ZipCode != "Y"){
$error.="The Zip Code provided does not match the information on file with your card issuer.<br>\n";
}
if ($CVM == "N"){
$error.="The code located on the back of the card provided does not match the information on file with your card issuer.<br>\n";
}
//if any errors occur
if ($error){
header("Location: http://www.whatnott.com/avsFailure.php");
}else{
header("Location: http://www.whatnott.com/avsPassed.php");
}
?>
If there are any errors, I want the error to be sent to the avsFailure.php page to display all of the errors. How do I get the value in the $error to pass to the next page?
This is the code on avsFailure.php to display the errors:
<?
if ($error) {//if there is any error message, print it to the screen
echo "<table width=550 align=\"center\" div align=\"center\"><br /><font color=red><b>The following problems occurred:</b><br /></font><font color=#000000 size=1>\n";
print ("$error");
}
?>
It goes to the correct page because there are errors but it won't display them.
Thanks for your help.