I have a review page that pulls data from a form like this
echo (!empty($_REQUEST['FW15LieAngle'])) ? "<div class='reviewItem'><span class='reviewTitle'>15.5 Lie Angle:</span>{$_REQUEST['FW15LieAngle']}</div>" : "";
so if they did pick that option it wont display on the form. At the end of the review page I send all the data to the mail.php file like so:
<form method="post" action="priceorder.php">
<ul>
<?php
if (is_array($_REQUEST)) {
foreach ($_REQUEST as $key => $val) {
// This code should support the checkboxes and multiple selects
if (is_array($val)) {
foreach ($val as $val2) {
echo "<input type='hidden' name='" . $key . "[]' value='" . $val2 . "' />";
}
}
else {
echo "<input type='hidden' name='" . $key . "' value='" . $val . "' />";
}
}
}
?>
</ul>
<input name="submit" type="submit" value="" onclick="verify();" class="submit"/>
</form>
in the mail.php file I would get the data from the review.php like so for a HTML email:
<div class='reviewItem'><span class='reviewTitle'>15.5 Lie Angle:</span>".$_REQUEST['FW15LieAngle']."</div>
This works fine but I would like it to work like the review page in that if this option had zero data it wouldnt show in the email. I tried adding the php like in the review.php but the email wont work. Any ideas or if it can be done so that if that field has no data it wont show in the HTML email???
append the email body like this:
if (!empty($_REQUEST['FW15LieAngle'])){
$emailBody.="<div class='reviewItem'><span class='reviewTitle'>15.5 Lie Angle:</span>".$_REQUEST['FW15LieAngle']."</div>";
}