Sorry for posting such a common question. To hide empty fields within an email I've used the below code
But I'm doing a form now that is a standard submit form but is really long and was hoping for a way to not send the empty fields in the email without having to enter the above code on every line. I remember reading a while back that it's possible to have a script that checks the field values that were dumped into a DB table and only send the un-empty fields in the email but I was unable to find that post in the forums.
This form's values are being dumped into a DB table which is already set up.
A push in the right direction would be greatly appreciated,
Wesley
<?php
if ( $_POST['name'] > 0 ) {
echo "Name: ".$_POST['name']."<br />";
}
if ( $_POST['email'] > 0 ) {
echo "Email: ".$_POST['email']."<br />";
}
etc.....
?>
But I'm doing a form now that is a standard submit form but is really long and was hoping for a way to not send the empty fields in the email without having to enter the above code on every line. I remember reading a while back that it's possible to have a script that checks the field values that were dumped into a DB table and only send the un-empty fields in the email but I was unable to find that post in the forums.
This form's values are being dumped into a DB table which is already set up.
A push in the right direction would be greatly appreciated,
Wesley