Help with form

I have a working form as is right now, but i am having a problem trying to add additional information if a user wants to add an additional field I have a button that will drop down another form, but I can’t figure out how to set up the code if the users adds to the field, another thing their can be up to 15 additional fields max.

[php]<?php
if(isset($_POST[‘postedChange’])) {
$subject = $_POST[‘formType’];
$message = "Employer: " . $_POST[‘employer’] . “\n” . "Employer Contact: " . $_POST[‘employerContact’] . “\n” . "Employer Contact Phone: " . $_POST[‘employerContactPhone’] . “\n” . "Employer Contact Email: " . $_POST[‘employerContactEmail’]. “\n” . “\n”. “Member Name: " . $_POST[‘memberFirstName’] .” “. $_POST[‘memberMiddleName’] .” ". $_POST[‘memberLastName’] . “\n” . “Date of Birth: " . $_POST[‘memberDOB’] . “\n” . “Gender: " . $_POST[‘memberGender’] .”\n” . "Email Address: " . $_POST[‘memberEmail’] . “\n” . "Home Address: " . $_POST[‘homeAddress’] . " ". $_POST[‘memberHomeCity’] . " " . $_POST[‘memberHomeState’] . " " . $_POST[‘memberHomeZip’] . “\n” . "Home Phone Number: " . $_POST[‘homePhone’] . “\n” . "Preferred Language: " . $_POST[‘language’] . “\n” . "Plan Change: " . $_POST[‘desiredPlanType’];
$from = $_POST[‘employerContact’] . " " . $_POST[‘employerContactEmail’];
$headers = “From: " . $from;
$to = "[email protected],[email protected]”;

$sent = mail($to,$subject,$message,$headers);

} elseif(isset($_POST[‘postedTerminate’])) {
$subject = $_POST[‘formType’];
$message = "Employer: " . $_POST[‘employer’] . “\n” . "Employer Contact: " . $_POST[‘employerContact’] . “\n” . "Employer Contact Phone: " . $_POST[‘employerContactPhone’] . “\n” . "Employer Contact Email: " . $_POST[‘employerContactEmail’]. “\n” . “\n”. “Member Name: " .” “. $_POST[‘memberFirstName’] .” “. $_POST[‘memberMiddleName’] .” ". $_POST[‘memberLastName’] . “\n” . “Date of Birth: " . $_POST[‘memberDOB’] . “\n” . “Gender: " . $_POST[‘memberGender’] .”\n” . "Email Address: " . $_POST[‘memberEmail’] . “\n” . "Home Address: " . $_POST[‘memberHomeAddress’] . " ". $_POST[‘memberHomeCity’] . " " . $_POST[‘memberHomeState’] . " " . $_POST[‘memberHomeZip’] . “\n” . "Home Phone Number: " . $_POST[‘homePhone’] . “\n” . "Preferred Language: " . $_POST[‘language’] . “\n” . "Termination Effective Date: " . $_POST[‘terminationEffectiveDate’];
$from = $_POST[‘employerContact’] . " " . $_POST[‘employerContactEmail’];
$headers = “From: " . $from;
$to = "[email protected]”;

$sent = mail($to,$subject,$message,$headers);

}elseif(isset($_POST[‘requestBusinessPlanQuote’])) {
$subject = $_POST[‘formType’];
$message = "Broker Name: " . $_POST[‘brokerName’] . “\n” . "Agency Name: " . $_POST[‘agencyName’] . “\n” . "Broker Address: " . $_POST[‘brokerAddress’] . " ". $_POST[‘brokerCity’] . " " . $_POST[‘brokerState’] . " " . $_POST[‘brokerZip’]. “\n” . "Broker Phone #: " . $_POST[‘brokerPhone’]. “\n” . “\n”. “Broker Fax #: " .” ". $_POST[‘brokerFax’] . “\n” . “Broker License #: " . $_POST[‘brokerLicenseNumber’] . “\n” . “Broker Email: " . $_POST[‘brokerEmail’] .”\n” . "Company Name: " . $_POST[‘companyName’] . “\n” . "Business Type: " . $_POST[‘businessType’]. “\n” . "Company Contact Name: " . $_POST[‘companyContactName’] . “\n” . "Company Address: " . $_POST[‘companyAddress’]. " ". $_POST[‘companyCity’] . " " . $_POST[‘companyState’] . " " . $_POST[‘companyZip’] . “\n” . "Company Phone: " . $_POST[‘companyPhone’] . “\n” . "Company Email: " . $_POST[‘companyEmail’] . “\n” . "Receive Quote By: " . $_POST[‘receiveQuoteBy’] . “\n” . "Comments: " . $_POST[‘comments’] . “\n” . "Current Carrier: " . $_POST[‘currentCarrier’] . “\n” . "Current Rates: " . $_POST[‘currentRates’] . “\n” . "Why Changing: " . $_POST[‘whyChanging’] . “\n” . "Percent Employees: " . $_POST[‘percentEmployees’] . “\n” . "Percent Dependants: " . $_POST[‘percentDependants’] . “\n” . "Desired Plan Type: " . $_POST[‘desiredPlanType’] . “\n” . "Date Of Coverag: " . $_POST[‘dateOfCoverag’] . “\n” . "Eligible Emloyees: " . $_POST[‘eligibleEmloyees’] . “\n” . "Eligible Dependants: " . $_POST[‘eligibleDependants’] . “\n” . "Desired Plan Type: " . $_POST[‘desiredPlanType’];
$from = $_POST[‘employerContact’] . " " . $_POST[‘employerContactEmail’];
$headers = “From: " . $from;
$to = "[email protected]”;

$sent = mail($to,$subject,$message,$headers);

if (isset($_POST['employee[i]Name'])) {
	$message = "employee[i]Name: " . $_POST['employee[i]Name'] . "\n" . "employee[i]DOB: " . $_POST['employee[i]DOB'] . "\n" . "employee[i]Gender: " . $_POST['employee[i]Gender'] . "\n" . "employee[i]DOB: " . $_POST['employee[i]DOB'] . "\n" . "employee[i]Status: " . $_POST['employee[i]Status'] . "\n" . "employee[i]DependantChildren: " . $_POST['employee[i]DependantChildren'] . "\n" . "employee[i]Status: " . $_POST['employee[i]Status'] . "\n" . "employee[i]Status: " . $_POST['employee[i]Status'];
	
$from = $_POST['employerContact'] . " " . $_POST['employerContactEmail'];
$headers = "From: " . $from;
$to = "[email protected]";

$sent = mail($to,$subject,$message,$headers);
$_POST += 1;

}

};
?>
[/php]

nvm I solved this

Sponsor our Newsletter | Privacy Policy | Terms of Service