why don't you make a function 🙂
this function will add those posted datas into a string (mailbody) whick is not emty.
first parameter is the post variable name, and the second , is a title, will appears in the mail.
<?
function addmail($value,$title)
{
if(!emty($POST[$value])) //check if the post value is not emty with the name $value
return($title.": ".$POST[$value]."\r\n"); //and creates the string...
}
$mailbody.=addmail("date","Date");
$mailbody.=addmail("email","Email");
$mailbody.=addmail("order_no","Order No");
$mailbody.=addmail("account_no","Account no");
$mailbody.=addmail("account_name","Account name");
$mailbody.=addmail("company_name","Company name");
$mailbody.=addmail("payment_method","Payment method");
$mailbody.=addmail("order_taken_by","Order taken by");
$mailbody.=addmail("account_address","Account address");
$mailbody.=addmail("delivery_address","Delivery address");
$mailbody.=addmail("delivery_service","Service required");
$mailbody.=addmail("product_colour_one","(1) Product colour");
$mailbody.=addmail("product_colour_two","(2) Product colour");
$mailbody.=addmail("product_colour_three","(3) Product colour");
$mailbody.=addmail("product_colour_four","(4) Product colour");
$mailbody.=addmail("product_colour_five","(5) Product colour");
$mailbody.=addmail("dealer_contact_name","Dealer contact name");
$mailbody.=addmail("dealer_telephone_no","Dealer telephone no");
$mailbody.=addmail("trust_stock_code_one","(1) Trust stock code");
$mailbody.=addmail("product_quantity_one","(1) Product quantity");
$mailbody.=addmail("trust_stock_code_two","(2) Trust stock code");
$mailbody.=addmail("product_quantity_two","(2) Product quantity");
$mailbody.=addmail("trust_stock_code_three","(3) Trust stock code");
$mailbody.=addmail("product_quantity_three","(3) Product quantity");
$mailbody.=addmail("trust_stock_code_four","(4) Trust stock code");
$mailbody.=addmail("product_quantity_four","(4) Product quantity");
$mailbody.=addmail("trust_stock_code_five","(5) Trust stock code");
$mailbody.=addmail("product_quantity_five","(5) Product quantity");
$mailbody.=addmail("special_instructions","Special instructions");
$mailbody.=addmail("delivery_user_contact_name","End user contact name");
$mailbody.=addmail("delivery_user_telephone_no","End user telephone no");
$mailbody.=addmail("supplier_stock_code_one","(1) Supplier stock code");
$mailbody.=addmail("product_description_one","(1) Product description");
$mailbody.=addmail("supplier_stock_code_two","(2) Supplier stock code");
$mailbody.=addmail("product_description_two","(2) Product description");
$mailbody.=addmail("supplier_stock_code_three","(3) Supplier stock code");
$mailbody.=addmail("product_description_three","(3) Product description");
$mailbody.=addmail("supplier_stock_code_four","(4) Supplier stock code");
$mailbody.=addmail("product_description_four","(4) Product description");
$mailbody.=addmail("supplier_stock_code_five","(5) Supplier stock code");
$mailbody.=addmail("product_description_five","(5) Product description");
print $mailbody;
?>