I have searched the forum and cannot find anything similar so hope someone can help me solve this
I have a flash form mailing data using php and it is working great except I would like to exclude from the email all the form fields that were left empty.
here is part of the php code I am using...
<?
$adminaddress = "myemail@mydomain.com";
$siteaddress ="http://www.mydomain.com";
$sitename = "My company name";
$date = date("m/d/Y H:i:s");
if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);
if ($action != ""):
mail("$adminaddress","Order",
"Message details:\n
Name: $fname
Date: $party_date
Delivery Date: $delivery_date
Delivery Time: $delivery_time
Number of Guests: $guests
Special Instructions:
------------------------------
$special_instructions
mail("$email","Thank you from $sitename",
"This message is to confirm we have received the order information for: $pname\n
Best Regards,
$sitename
$siteaddress","FROM:$adminaddress");
$sendresult = "Thank you for visiting <a href = \"$siteaddress\" target = \"_blank\"><u>$sitename</u></a>. You will receive a confirmation email shortly. ";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo "$send_answer";
endif;
?>
Of course the values are coming from the flash side but I was hoping to solve this with some code on the php to exclude the empty fields values...