$v){
foreach($badStrings as $v2){
if(strpos($v, $v2) !== false){
header("HTTP/1.0 403 Forbidden");
exit;
}
}
}
unset($k, $v, $v2, $badStrings, $authHosts, $fromArray, $wwwUsed);
$my_form = new validator;
if ($my_form->validate_fields('name, email')) { // Required Fields
$display = '
Thank you. We will be in touch shortly.
';
$display .= 'A copy of your message has also been sent to the e-mail address you provided.
';
$mail = new PHPMailer();
$mail->IsHTML(true);
// Add Attachment
$mail->AddAttachment($_FILES['attached_file']['tmp_name'],$_FILES['attached_file']['name']);
// Add Attachment 2
$mail->AddAttachment($_FILES['attached_file2']['tmp_name'],$_FILES['attached_file2']['name']);
// Add Attachment 3
$mail->AddAttachment($_FILES['attached_file3']['tmp_name'],$_FILES['attached_file3']['name']);
$mail->From = $_POST['email']; // The email field
$mail->FromName = $_POST['name']; // The name field
$mail->AddAddress('emailaddresshere'); // the form will be sent to this address
$mail->AddAddress($_POST['email'],$_POST['name']); // form email field, form name field so we can send a copy to the form sender
$mail->Subject = 'Evaluation Form'; // the subject of email
// html text block
$mail->Body .= '
| First Name: | ' . $_POST['name'] . ' |
' . "\n";
$mail->Body .= '
| Last Name: | ' . $_POST['lname'] . ' |
' . "\n";
$mail->Body .= '
| Sex: | ' . $_POST['sex1'] . $_POST['sex2'] . ' |
' . "\n";
$mail->Body .= '
| DOB: | ' . $_POST['dob'] . ' |
' . "\n";
$mail->Body .= '
| Email: | ' . $_POST['email'] . ' |
' . "\n";
$mail->Body .= '
| Phone: | ' . $_POST['phone'] . ' |
' . "\n";
$mail->Body .= '
| Address: | ' . $_POST['address'] . ' |
' . "\n";
$mail->Body .= '
| Preferred Method of Contact: | ' . $_POST['email1'] . $_POST['phone1'] . ' |
' . "\n";
$mail->Body .= '
| Current Level of Hair Loss: | ' . $_POST['level1'] . $_POST['level2'] . $_POST['level3'] . $_POST['level4'] . $_POST['level5'] . $_POST['level6'] . $_POST['level7'] . $_POST['level8'] . $_POST['level9'] . ' |
' . "\n";
$mail->Body .= '
| Family History of Hair Loss: | ' . $_POST['history1'] . $_POST['history2'] . ' |
' . "\n";
$mail->Body .= '
| Currently Using Any Medications: | ' . $_POST['med1'] . $_POST['med2'] . $_POST['med3'] . $_POST['med4'] . ' |
' . "\n";
$mail->Body .= '
| Have You Ever Had Hair Transplant Before? : | ' . $_POST['transp1'] .$_POST['transp2'] . ' |
' . "\n";
$mail->Body .= '
| If so, how many grafts: | ' . $_POST['grafts'] . ' |
' . "\n";
$mail->Body .= '
| Like to Achieve: | ' . $_POST['achieve'] . ' |
' . "\n";
$mail->Body .= '
| Hair Texture: | ' . $_POST['texture1'] . $_POST['texture2'] . $_POST['texture3'] . ' |
' . "\n";
$mail->Body .= '
| How Did You Hear About Us: | ' . $_POST['hear1'] . $_POST['hear2'] . $_POST['hear3'] . $_POST['hear4'] . $_POST['hear5'] . $_POST['hear6'] . ' |
' . "\n";
$mail->Body .= '' . "\n";
// plain text block
$mail->AltBody .= 'First Name:' . $_POST['name'] . "\n";
$mail->AltBody .= 'Last Name:' . $_POST['lname'] . "\n";
$mail->AltBody .= 'Sex:' . $_POST['sex1'] . $_POST['sex2'] . "\n";
$mail->AltBody .= 'DOB:' . $_POST['dob'] . "\n";
$mail->AltBody .= 'Email:' . $_POST['email'] . "\n";
$mail->AltBody .= 'Phone:' . $_POST['phone'] . "\n";
$mail->AltBody .= 'Address:' . $_POST['address'] . "\n";
$mail->AltBody .= 'Preferred Method of Contact:' . $_POST['email1'] . $_POST['phone1'] . "\n";
$mail->AltBody .= 'Current Level of Hair Loss:' . $_POST['level1'] . $_POST['level2'] . $_POST['level3'] . $_POST['level4'] . $_POST['level5'] . $_POST['level6'] . $_POST['level7'] . $_POST['level8'] . $_POST['level9'] . "\n";
$mail->AltBody .= 'Family History of Hair Loss:' . $_POST['history1'] . $_POST['history2'] . "\n";
$mail->AltBody .= 'Currently Using Any Medications:' . $_POST['med1'] . $_POST['med2'] . $_POST['med3'] . $_POST['med4'] . "\n";
$mail->AltBody .= 'Have You Ever Had Hair Transplant Before? :' . $_POST['transp1'] .$_POST['transp2'] . "\n";
$mail->AltBody .= 'If so, how many grafts:' . $_POST['grafts'] . "\n";
$mail->AltBody .= 'Like to Achieve:' . $_POST['achieve'] . "\n";
$mail->AltBody .= 'Hair Texture:' . $_POST['texture1'] . $_POST['texture2'] . $_POST['texture3'] . "\n";
$mail->AltBody .= 'How Did You Hear About Us:' . $_POST['hear1'] . $_POST['hear2'] . $_POST['hear3'] . $_POST['hear4'] . $_POST['hear5'] . $_POST['hear6'] . "\n";
$mail->Send();
} else {
$display = '
' . $my_form->error . '
';
}
}
?>