Copy link to clipboard
Copied
Hello,
I have worked on this for WAY too long now. I have a form set up, I have the PHP script worked out. I wanted to send the e-mail via HTML, I've gotten that to work now, but I still have the plaintext version in there (killed) if you're wondering why. Reason being, when the e-mail comes through, I can see everything in the form except for the 5 or 6 <select> tags (well, boiler, irrigation, pool, hot_tub, fire, climate, other) I have in the form. Whether I try to run it in HTML or a plain text e-mail, their values do NOT show up. I've tried to make their values "1" or "2" for "yes" and "no". I've tried to make them "yes" or "no". "Yes" or "No". I've tried eliminating the "select" choice. Nothing works. Can anyone tell me why? I'm stumped.
Thank you.
Page location is:
http://www.backflowsolutions.com/Pages/Surveys.html
PHP coding is:
<?PHP
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$clientIP = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$clientIP = $_SERVER['REMOTE_ADDR'];
}
if ( isset($_REQUEST['formstogoimgflt']) ) {
CaptchaGenerator();
exit;
}
$FTGname = DoStripSlashes( $_POST['name'] );
$FTGaddress1 = DoStripSlashes( $_POST['address1'] );
$FTGaddress2 = DoStripSlashes( $_POST['address2'] );
$FTGcity = DoStripSlashes( $_POST['city'] );
$FTGstate = DoStripSlashes( $_POST['state'] );
$FTGzip = DoStripSlashes( $_POST['zip'] );
$FTGaccount = DoStripSlashes( $_POST['account'] );
$FTGphone = DoStripSlashes( $_POST['phone'] );
$FTGwell_group = DoStripSlashes( $_POST['well'] );
$FTGboiler_group = DoStripSlashes( $_POST['boiler'] );
$FTGirr_group = DoStripSlashes( $_POST['irrigation'] );
$FTGpool_group = DoStripSlashes( $_POST['pool'] );
$FTGspa_group = DoStripSlashes( $_POST['hot_tub'] );
$FTGfire_group = DoStripSlashes( $_POST['fire'] );
$FTGclimate_group = DoStripSlashes( $_POST['climate'] );
$FTGother_group = DoStripSlashes( $_POST['other'] );
$FTGother_specified = DoStripSlashes( $_POST['other_specified'] );
$FTGaccesscode = DoStripSlashes( $_POST['accesscode'] );
$FTGcertification = DoStripSlashes( $_POST['certification'] );
# Embed error page and dump it to the browser
if ($validationFailed === true) {
$fileErrorPage = 'TestingFormErrors.html';
if (file_exists($fileErrorPage) === false) {
echo '<html><head><title>Error</title></head><body>The error page: <b>' . $fileErrorPage. '</b> cannot be found on the server.</body></html>';
exit;
}
$errorPage = ProcessPHPFile($fileErrorPage);
$errorList = @implode("<br />\n", $FTGErrorMessage);
$errorPage = str_replace('<!--VALIDATIONERROR-->', $errorList, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:name-->', $FTGname, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:address1-->', $FTGaddress1, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:address2-->', $FTGaddress2, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:city-->', $FTGcity, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:state-->', $FTGstate, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:zip-->', $FTGzip, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:account-->', $FTGaccount, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:phone-->', $FTGphone, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:well-->', $FTGwell, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:boiler-->', $FTGboiler, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:irrigation-->', $FTGirrigation, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:pool-->', $FTGpool, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:hot_tub-->', $FTGhot_tub, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:fire-->', $FTGfire, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:climate-->', $FTGclimate, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:other-->', $FTGother, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:other_specified-->', $FTGother_specified, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:accesscode-->', $FTGaccesscode, $errorPage);
$errorPage = str_replace('<!--FIELDVALUE:certification-->', $FTGcertification, $errorPage);
echo $errorPage;
}
if ( $validationFailed === false ) {
# Email to Form Owner
$emailSubject = FilterCChars("Survey from Backflowsolutions.com!");
$emailBody =
/*"Name : $FTGname\n"
. "Address : $FTGaddress1\n"
. "Address : $FTGaddress2\n"
. "City : $FTGcity\n"
. "State : $FTGstate\n"
. "Zip_Code : $FTGzip\n"
. "Water Account : $FTGaccount\n"
. "Phone : $FTGphone\n"
. "Private Well/Water Source : $FTGwell\n"
. "Boiler : $FTGboiler\n"
. "Lawn Irrigation : $FTGirrigation\n"
. "Swimming Pool : $FTGpool\n"
. "Hot Tub/Spa : $FTGhot_tub\n"
. "Fire Sprinkler : $FTGfire\n"
. "Climate Control : $FTGclimate\n"
. "Other Equipment : $FTGother\n"
. "Specify Other : $FTGother_specified\n"
. "I certify the above information is truthful and accurate to the best of my ability : $FTGcertification\n"
. "";*/
"<html>
<body>
<table width=\"583\" border='0'>
<tr>
<td width=\"137\">Village of Glenview</td>
<td width=\"350\"> </td>
<td width=\"82\"> </td>
</tr>
<tr>
<td> </td>
<td colspan=\"2\"> </td>
</tr>
<tr>
<td> </td>
<td colspan=\"2\">Please select whether or not your facility contains the following:</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>Private well or water source?</td>
<td>$FTGwell</td>
</tr>
<tr>
<td> </td>
<td>Boiler?</td>
<td>$FTGboiler</td>
</tr>
<tr>
<td> </td>
<td>Permanent lawn irrigation system?</td>
<td>$FTGirrigation</td>
</tr>
<tr>
<td> </td>
<td>Swimming pool directly piped to public water supply?</td>
<td>$FTGpool</td>
</tr>
<tr>
<td> </td>
<td>Hot tub or spa directly piped to public water supply?</td>
<td>$FTGhot_tub</td>
</tr>
<tr>
<td> </td>
<td>Fire sprinkler system?</td>
<td>$FTGfire</td>
</tr>
<tr>
<td>$FTGname</td>
<td>Climate control system using water?</td>
<td>$FTGclimate</td>
</tr>
<tr>
<td>$FTGaddress1</td>
<td>Other equipment or connections?</td>
<td>$FTGother</td>
</tr>
<tr>
<td>$FTGaddress2</td>
<td align=\"right\">$FTGother_specified</td>
<td> </td>
</tr>
<tr>
<td>$FTGcity, $FTGstate $FTGzip</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>$FTGaccount</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>$FTGphone</td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>";
ini_set('sendmail_from', FilterCChars("surveys@backflowsolutions.com"));
$emailTo = 'webmaster@backflowsolutions.com';
$emailFrom = FilterCChars("surveys@backflowsolutions.com");
$emailHeader = "From: $emailFrom\n"
. "MIME-Version: 1.0\n"
. "Content-type: text/html; charset=\"ISO-8859-1\"\n"
. "Content-transfer-encoding: 7bit\n";
mail($emailTo, $emailSubject, $emailBody, $emailHeader);
DeleteCaptcha($FTGaccesscode);
# Redirect user to success page
header("Location: http://www.backflowsolutions.com/Pages/survey_received.html");
}
?>
Copy link to clipboard
Copied
I suspect the problem might be connected with the large number of validation errors on the page. Try running the form through the W3C validator. There are missing closing tags, which could be causing the form to be misread.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more