Jump to content

Form Processing issue


stmosaic

Recommended Posts

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);
          }
}
  
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.