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 = "[email protected]"; $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 = "[email protected]"; $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 = "[email protected]"; $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); } } } Link to comment https://forums.phpfreaks.com/topic/61550-form-processing-issue/ 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.. Link to comment https://forums.phpfreaks.com/topic/61550-form-processing-issue/#findComment-306400 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. Link to comment https://forums.phpfreaks.com/topic/61550-form-processing-issue/#findComment-306407 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. Link to comment https://forums.phpfreaks.com/topic/61550-form-processing-issue/#findComment-306412 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? Link to comment https://forums.phpfreaks.com/topic/61550-form-processing-issue/#findComment-306529 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.