'; } # Include message in error page and dump it to the browser if ($ValidationFailed === true) { $ErrorPage = 'Error'; $ErrorPage .= 'Errors found: '; $ErrorPage .= ''; $ErrorPage = str_replace('', $ErrorList, $ErrorPage); $ErrorPage = str_replace('', $FTGname, $ErrorPage); $ErrorPage = str_replace('', $FTGsurname, $ErrorPage); $ErrorPage = str_replace('', $FTGemail, $ErrorPage); $ErrorPage = str_replace('', $FTGaddress, $ErrorPage); $ErrorPage = str_replace('', $FTGhomephonenumber, $ErrorPage); $ErrorPage = str_replace('', $FTGcellphonenumber, $ErrorPage); $ErrorPage = str_replace('', $FTGoccupation, $ErrorPage); $ErrorPage = str_replace('', $FTGage, $ErrorPage); $ErrorPage = str_replace('', $FTGheight, $ErrorPage); $ErrorPage = str_replace('', $FTGhaircolour, $ErrorPage); $ErrorPage = str_replace('', $FTGEyecolour, $ErrorPage); $ErrorPage = str_replace('', $FTGProvince, $ErrorPage); $ErrorPage = str_replace('', $FTGpicture, $ErrorPage); $ErrorPage = str_replace('', $FTGReset, $ErrorPage); $ErrorPage = str_replace('', $FTGSubmit, $ErrorPage); $ErrorPage = str_replace('', $FTGemail_errmsg, $ErrorPage); echo $ErrorPage; exit; } # Email to Form Owner $emailSubject = FilterCChars("Promotion Application Form"); $emailBody = "--FTG_BOUNDRY\n" . "Content-Type: multipart/alternative; boundary=\"FTG_INNERBOUNDRY\"\n" . "\n" . "--FTG_INNERBOUNDRY\n" . "Content-Type: text/plain; charset=\"ISO-8859-1\"\n" . "Content-Transfer-Encoding: 8bit\n" . "\n" . "name : $FTGname\n" . "surname : $FTGsurname\n" . "email : $FTGemail\n" . "address : $FTGaddress\n" . "homephonenumber : $FTGhomephonenumber\n" . "cellphonenumber : $FTGcellphonenumber\n" . "occupation : $FTGoccupation\n" . "age : $FTGage\n" . "height : $FTGheight\n" . "haircolour : $FTGhaircolour\n" . "Eyecolour : $FTGEyecolour\n" . "Province : $FTGProvince\n" . "picture : $FTGpicture\n" . "Reset : $FTGReset\n" . "Submit : $FTGSubmit\n" . "" . "\n" . "--FTG_INNERBOUNDRY\n" . "Content-Type: text/html; charset=\"ISO-8859-1\"\n" . "Content-Transfer-Encoding: base64\n" . "\n" . chunk_split(base64_encode("\n" . "\n" . "\n" . "\n" . "\n" . "name : $FTGname
\n" . "surname : $FTGsurname
\n" . "email : $FTGemail
\n" . "address : $FTGaddress
\n" . "homephonenumber : $FTGhomephonenumber
\n" . "cellphonenumber : $FTGcellphonenumber
\n" . "occupation : $FTGoccupation
\n" . "age : $FTGage
\n" . "height : $FTGheight
\n" . "haircolour : $FTGhaircolour
\n" . "Eyecolour : $FTGEyecolour
\n" . "Province : $FTGProvince
\n" . "picture : $FTGpicture
\n" . "Reset : $FTGReset
\n" . "Submit : $FTGSubmit
\n" . "\n" . "\n" . "")) . "\n" . "--FTG_INNERBOUNDRY--\n"; if ( is_uploaded_file($_FILES['picture']['tmp_name']) ) { $fileName = $_FILES['picture']['tmp_name']; $fileHandle = fopen($fileName, 'r'); $fileAttach = fread($fileHandle, filesize ($fileName)); fclose($fileHandle); $fileAttach = chunk_split(base64_encode($fileAttach)); $emailBody .= "--FTG_BOUNDRY\n" . "Content-Type: " . $_FILES['picture']['type'] . "; name=\"" . $_FILES['picture']['name'] . "\"\n" . "Content-disposition: attachment\n" . "Content-transfer-encoding: base64\n" . "\n" . "$fileAttach\n" . "\n"; } $emailBody .= "--FTG_BOUNDRY--\n"; $emailTo = "Zach "; $emailFrom = FilterCChars("$FTGemail"); $emailHeader = "From: $emailFrom\n" . "MIME-Version: 1.0\n" . "Content-Type: multipart/mixed; type=\"multipart/alternative\"; boundary=\"FTG_BOUNDRY\"\n" . "\n"; mail($emailTo, $emailSubject, $emailBody, $emailHeader); # Redirect user to success page header("Location: thankyou.html"); exit; ?>