Hi all
I am trying to avoid submitting fields that are left empty in my flash form.
I dont really want to receive all the field names in my email if they dont have any value.
This is the php code I am using with my flash form:
<?
$adminaddress = "myemail@domain.com";
$siteaddress =www.mydomain.com;
$sitename = "My Company";
$date = date("m/d/Y H:i:s");
if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);
if ($action != ""):
mail("$adminaddress","Online Order",
"Details:
Name: $pname
Event Date: $party_date
Event Time: $event_time
Delivery Date: $delivery_date
Delivery Time: $delivery_time
Number of Guests: $guests
Cake Design: $design_choice
Order 1
Cake Flavor: $color - Other Flavor: $other_flavor
Cake Filling1: $style - Other Filling 1: $other_1_filling
Cake Filling2: $shape - Other Filling 2: $other_2_filling
Special Instructions:
------------------------------
$special_instructions
------------------------------
Optional Order 2
Cake Flavor2: $polishing -Other Flavor Combo 2: $other_flavor_combo2
Cake Filling1: $design - Other Filling 1 Combo 2: $other_filling1_combo2
Cake Filling2: $lettering - Other Filling 2 Combo 2: $other_filling2_combo2
------------------------------
Logged Info :
------------------------------
Using: $HTTP_USER_AGENT
Hostname: $ip
IP address: $REMOTE_ADDR
Date/Time: $date","FROM:$adminaddress");
mail("$email","Thank you from $sitename",
"This message is to confirm we have received the order information for: $pname
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;
?>
The field names I would like to avoid receiving, if empty, are:
Other Flavor: $other_flavor
Other Filling 1: $other_1_filling
Other Filling 2: $other_2_filling
Other Flavor Combo 2: $other_flavor_combo2
Other Filling 1 Combo 2: $other_filling1_combo2
Other Filling 2 Combo 2: $other_filling2_combo2
Here is a little description of how the form works:
Unless users cannot find their preferred flavor or fillings in the correspondent drop down menu present on my flash form, then they must select "others" and specify ther flavor in the “Other Flavor” text field.
Same goes for the cake fillings 1, filling 2 etc.
If they find their flavor and fillings in the drop down menu (most of the times they do), these “others - specify” fields will always be empty…
Hope I was able to explain it and someone can help me accomplish this…
thank you