stmosaic Posted July 24, 2007 Share Posted July 24, 2007 Been working on this for weeks and am quite frustrated that none of my varied modifications have made much of a difference. Is anybody able to help me out with this? I have abbreviated the code to highlight the problem areas. When the form data is emailed, if more than one checkbox (each with a distinct name & value), is checked, the info output in the email of selections #2 and #3 are repeated 2 - 3 times. Other than that small glitch, everything works perfectly. Abbreviated code is below. I would greatly appreciate any help with this! FORM CODE SNIPPET <input type="checkbox" name="city0" value="CryC"> <input type="checkbox" name="city1" value="CH"> <input type="checkbox" name="city2" value="OB"> ABBREVIATED PROCESSOR CODE $if ($formname == "accom" && isset($CryC)) { $SendTo = "CryC-Accom@domain.com"; $SubjectLine = "CRYSTAL COAST $formname Lead from\n"; //Variable processing// include 'fprocessA.php'; // Send E-Mail // if (count($_POST) != 0) { $Spam = false; foreach ($_POST as $Field=>$Value) { $Spam = $Spam || stristr($Value, "bcc: "); } if (!$Spam) { $mailheaders = "From: $SendFrom \r\n"; $mailheaders .= "Reply-To: $Reply_To \r\n"; mail($SendTo, $SubjectLine, $MsgBody, $mailheaders); } } } if ($formname == "accom" && isset($CH)) { $SendTo = "CH-Accom@domain.com"; $SubjectLine = "CHARLESTON SC $formname Lead from\n"; include 'fprocessA.php'; // Send E-Mail // if (count($_POST) != 0) { $Spam = false; foreach ($_POST as $Field=>$Value) { $Spam = $Spam || stristr($Value, "bcc: "); } if (!$Spam) { $mailheaders = "From: $SendFrom \r\n"; $mailheaders .= "Reply-To: $Reply_To \r\n"; mail($SendTo, $SubjectLine, $MsgBody, $mailheaders); } } } if ($formname == " accom" && isset($OB)) { $SendTo = "OB-Accom@domain.com"; $SubjectLine = "NC OUTER BANKS $formname Lead from\n"; include 'fprocessA.php'; // Send E-Mail // if (count($_POST) != 0) { $Spam = false; foreach ($_POST as $Field=>$Value) { $Spam = $Spam || stristr($Value, "bcc: "); } if (!$Spam) { $mailheaders = "From: $SendFrom \r\n"; $mailheaders .= "Reply-To: $Reply_To \r\n"; mail($SendTo, $SubjectLine, $MsgBody, $mailheaders); } } } Quote Link to comment Share on other sites More sharing options...
hackerkts Posted July 24, 2007 Share Posted July 24, 2007 $if ($formname == "accom" && isset($CryC)) Why there's $? I would suggest you to use this, if $_POST['city0'] == 'CryC' etcs.. Quote Link to comment Share on other sites More sharing options...
stmosaic Posted July 24, 2007 Author Share Posted July 24, 2007 Those are defined earlier in the code: $CryC = $_POST['city0']; $CH = $_POST['city1']; $OB = $_POST['city2']; I shortened the code, sorry, I forgot to add that tidbit. Quote Link to comment Share on other sites More sharing options...
stmosaic Posted July 24, 2007 Author Share Posted July 24, 2007 the $ before the if must be a copy & paste error, it doesn't exist in my real code. Quote Link to comment Share on other sites More sharing options...
stmosaic Posted July 24, 2007 Author Share Posted July 24, 2007 Tried the if $_POST['city0'] == 'CryC' , but it made no difference. Anybody have any other ideas? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.