I have a sendmail.php script which evaluates whether or not certain pieces of information are available and/or are within the correct parameters. Within this code I have defined two variables :
$maxsamples = 3;
$minsamples = 1;
I also have another variable which is a summation of several variables, all of which are posted to this script with a numeric value between 1.01 and 1.17.
$results = $AXISR + $AXISF + $DPRIC + $DSBIC + $DSRIC + $DS5050 + $DS4060 + $DS6040 + $PBREG + $PBFINE + $PCDA + $PCSEL + $PCSMR + $PCMC + $TPBIC + $TPRIC + $TPPMC;
I'm trying to deploy the email if the $results are > $minsamples but < $maxsamples, since we only allow 3 samples and it's pointless to send the form if they don't select anything.
To evaluate this, I'm using an IF statement as follows:
if (($results < $maxsamples)&&($results > $minsamples)) {
echo "<h1>Thank you for your interest in our products. Your samples should ship within 3-5 business days.</h1>";
mail($recipient, $subject, $msg, $mailheaders);
} else {
echo "<i>Oops.. we think you may have missed something, please use your browser's \"Back\" button to correct and resubmit your request for samples.<br /><br />Make sure of the following:<ul><li>Select no more than 3 (three) products.<li>Fill in all required contact information fields.</i></ul>";
};
For some reason this is not working as expected.
I've tried replacing the $maxsamples and $minsamples with real numbers and it still won't work. I'm even echoing on screen what each variable to make sure the values are as expected and they always print correctly.
I've defined all the variables, I think I'm using the correct comparison operators and syntax, but I'm missing something.
Any ideas? Thanks!