I am trying to write code that will let a user enter information in an optional content, if the user uses them then that is then added to the e-mail that is sent back to me. Every thing does work other then getting the while loop to bring back that optional data if any.
can anyone point out what i have wrong?
[php] elseif(isset($_POST[‘postedRequest’])) {
$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” . “\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’];
$i = 0;
while ($i <= 14) {
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'];
$i++;
};
};
$from = $_POST['employerContact'] . " " . $_POST['employerContactEmail'];
$headers = "From: " . $from;
$to = "[email protected]";
};
$sent = mail($to,$subject,$message,$headers);[/php]