I have a php form that sends an email with all the information that was typed into the form. Works perfectly. But it then sends a blank email. What causes the second blank email to be sent? I have a php.ini file uploaded as well.
Here is the php code:
PHP Code:
<?php
$txtTo = "example@example.com";
$strSubject="Broker Order Form";
$strBody = "BILLING INFORMATION ";
$strBody = $strBody . "\nBroker Name: ".$brokername;
$strBody = $strBody . "\nCompany Name: ".$companyname;
$strBody = $strBody . "\nPO: ".$po;
$strBody = $strBody . "\nStreet Address: ".$address;
$strBody = $strBody . "\nCity: ".$city;
$strBody = $strBody . "\nState: ".$state;
$strBody = $strBody . "\nZip Code: ".$zip;
$strBody = $strBody . "\nTelephone: ".$telephone;
$strBody = $strBody . "\nFax: ".$fax;
$strBody = $strBody . "\nEmail Address: ".$email;
$strBody = $strBody . "\nSHIPPING INFORMATION: ";
$strBody = $strBody . "\nName: ".$shipname;
$strBody = $strBody . "\nCompany: ".$shipcompany;
$strBody = $strBody . "\nStreet Address: ".$shipaddress;
$strBody = $strBody . "\nCity: ".$shipcity;
$strBody = $strBody . "\nState: ".$shipstate;
$strBody = $strBody . "\nZip Code: ".$shipzip;
if($fruitpunch1 != "")
$strBody = $strBody . "\n\nJUST DELIGHT 128 oz Fruit Punch: ".$fruitpunch1;
if($kiwistrawberry2 != "")
$strBody = $strBody . "\n\nJUST DELIGHT 128 oz Kiwi Strawberry: ".$kiwistrawberry2;
if($citruspunch3 != "")
$strBody = $strBody . "\n\nJUST DELIGHT 128 oz Citrus Punch: ".$citruspunch3;
if($fruitpunch4 != "")
$strBody = $strBody . "\n\nJUST DELIGHT 64 oz Fruit Punch: ".$fruitpunch4;
if($kiwistrawberry5 != "")
$strBody = $strBody . "\n\nJUST DELIGHT 64 oz Kiwi Strawberry: ".$kiwistrawberry5;
if($citruspunch6 != "")
$strBody = $strBody . "\n\nJUST DELIGHT 64 oz Citrus Punch: ".$citruspunch6;
if($fruitpunch7 != "")
$strBody = $strBody . "\n\nJUST DELIGHT 16 oz Fruit Punch: ".$fruitpunch7;
if($kiwistrawberry8 != "")
$strBody = $strBody . "\n\nJUST DELIGHT 16 oz Kiwi Strawberry: ".$kiwistrawberry8;
if($citruspunch9 != "")
$strBody = $strBody . "\n\nJUST DELIGHT 16 oz Citrus Punch: ".$citruspunch9;
if($fruitpunch10 != "")
$strBody = $strBody . "\n\nJUST DELIGHT 8 oz/6 pk Fruit Punch: ".$fruitpunch10;
if($kiwistrawberry11 != "")
$strBody = $strBody . "\n\nJUST DELIGHT 8 oz/6 pk Kiwi Strawberry: ".$kiwistrawberry11;
if($citruspunch12 != "")
$strBody = $strBody . "\n\nJUST DELIGHT 8 oz/6pk Citrus Punch: ".$citruspunch12;
if($fruitpunch13 != "")
$strBody = $strBody . "\n\nJUST DELIGHT 8 oz/4pk Fruit Punch: ".$fruitpunch13;
if($kiwistrawberry14 != "")
$strBody = $strBody . "\n\nJUST DELIGHT 8 oz/4pk Kiwi Strawberry: ".$kiwistrawberry14;
if($citruspunch15 != "")
$strBody = $strBody . "\n\nJUST DELIGHT 8 oz/4pk Citrus Punch: ".$citruspunch15;
if($squatquart16 != "")
$strBody = $strBody . "\n\nJUST DELIGHT 32 oz Squat Quart Fruit Punch: ".$squatquart16;
if($squatquart42 != "")
$strBody = $strBody . "\n\nJUST DELIGHT 32 oz Squat Quart Orange Citrus: ".$squatquart42;
if($squatquart43 != "")
$strBody = $strBody . "\n\nJUST DELIGHT 32 oz Squat Quart Kiwi Strawberry: ".$squatquart43;
if($smfruitpunch17 != "")
$strBody = $strBody . "\n\nSUDDEN IMPACT Fruit Punch: ".$smfruitpunch17;
if($tsfruitpunch18 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz Fruit Punch 20 Bottles/Case: ".$tsfruitpunch18;
if($tskiwistrawberry19 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz Kiwi Strawberry 20 Bottles/Case: ".$tskiwistrawberry19;
if($tscitruspunch20 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz Citrus Punch 20 Bottles/Case: ".$tscitruspunch20;
if($tsblueraspberry21 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz Blue Raspberry 20 Bottles/Case: ".$tsblueraspberry21;
if($tsgrape22 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz Grape 20 Bottles/Case: ".$tsgrape22;
if($tsislandmango23 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz Island Mango 20 Bottles/Case: ".$tsislandmango23;
if($tslemonlime24 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz Lemon Lime 20 Bottles/Case: ".$tslemonlime24;
if($tsorange25 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz Orange 20 Bottles/Case: ".$tsorange25;
if($tsvariety44 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz Variety 20 Bottles/Case: ".$tsvariety44;
if($tsfruitpunch26 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz Fruit Punch 40 Bottles/Case: ".$tsfruitpunch26;
if($tskiwistrawberry27 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz Kiwi Strawberry 40 Bottles/Case: ".$tskiwistrawberry27;
if($tscitruspunch28 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz Citrus Punch 40 Bottles/Case: ".$tscitruspunch28;
if($tsblueraspberry29 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz Blue Raspberry 40 Bottles/Case: ".$tsblueraspberry29;
if($tsgrape30 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz Grape 40 Bottles/Case: ".$tsgrape30;
if($tsislandmango31 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz Island Mango 40 Bottles/Case: ".$tsislandmango31;
if($tslemonlime32 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz Lemon Lime 40 Bottles/Case: ".$tslemonlime32;
if($tsorange33 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz Orange 40 Bottles/Case: ".$tsorange33;
if($tsvariety45 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz Variety 40 Bottles/Case: ".$tsvariety45;
if($tsfruitpunch46 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz/6pk Fruit Punch: ".$tsfruitpunch46;
if($tsorange47 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz/6pk Orange: ".$tsorange47;
if($tsgrape48 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8 oz/6pk Grape: ".$tsgrape48;
if($tsbluerspbry49 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 8oz/6pk Blue Rasberry: ".$tsbluerspbry49;
if($tsfruitpunch34 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 16 oz Fruit Punch: ".$tsfruitpunch34;
if($tskiwistrawberry35 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 16 oz Kiwi Strawberry: ".$tskiwistrawberry35;
if($tscitruspunch36 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 16 oz Citrus Punch: ".$tscitruspunch36;
if($tsblueraspberry37 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 16 oz Blue Raspberry: ".$tsblueraspberry37;
if($tsgrape38 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 16 oz Grape: ".$tsgrape38;
if($tsislandmango39 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 16 oz Island Mango: ".$tsislandmango39;
if($tslemonlime40 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 16 oz Lemon Lime: ".$tslemonlime40;
if($tsorange41 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 16 oz Orange: ".$tsorange41;
if($tsfruitpunch50 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 32 oz Squat Quart Fruit Punch: ".$tsfruitpunch50;
if($tsorange51 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 32 oz Squat Quart Orange: ".$tsorange51;
if($tsgrape52 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 32 oz Squat Quart Grape: ".$tsgrape52;
if($tsbluersbry53 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 32 oz Squat Quart Blue Raspberry: ".$tsbluersbry53;
if($tsfruitpunch54 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 128 oz Dairy Style Fruit Punch: ".$tsfruitpunch54;
if($tsorange55 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 128 oz Dairy Style Orange: ".$tsorange55;
if($tsgrape56 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 128 oz Dairy Style Grape: ".$tsgrape56;
if($tsbluersbry57 != "")
$strBody = $strBody . "\n\nTHIRST SQUIRTS 128 oz Dairy Style Blue Raspberry: ".$tsbluersbry57;
$headers .= "From: " .$companyname." \r\n";
mail($txtTo, $strSubject, $strBody,$headers);
?>
thanks for the help
Peter