// You also need to load the JS file used by the date chooser, if you choose to use this field: // // If you are using the stand-alone mode, these will be added automatically // LANGUAGE SETTING // The relative path to the language file you want to use. $language = 'lang/English.php'; // FULL URL TO SCRIPT // The full URL to dd-formmailer.php (or whatever you have renamed it to) $script_path = 'http://imaginoz.com/imaginoz-comments.html'; // FULL URL TO CONTACT PAGE // If you are running this script in standalone mode, leave this blank. Otherwise, // enter the full URL to the page that is displaying the form $path_contact_page = ''; // RECIPIENT DATA // If you are just sending email to a single address, enter it here. For more advanced // usage such as multiple recipients, CC, BCC, etc.. please see the web page for instructions $recipients = 'mike@imaginoz.com'; // FORM STRUCTURE // This is used to generate the form. Each form element must be on its own line. // Detailed usage instructions can be found on the web page $form_struct = ' type=text|class=fmtext|label=Name|fieldname=fm_name|max=100|req=true type=text|class=fmtext|label=Email|fieldname=fm_email|max=100|req=true|ver=email type=text|class=fmtext|label=Subject|fieldname=fm_subject|max=100|req=true type=verify|class=fmverify|label=Verify type=textarea|class=fmtextarea|label=Message|fieldname=fm_message|max=1000|rows=6|req=true '; // MANUAL FORM CODE // Advanced users only! please read documentation first $manual_form_code = ''; // WRAP MESSAGES // If enabled, this wraps messages to 70 chars per line (for RFC compliance) $wrap_messages = TRUE; // SAVE ATTACHMENTS // If enabled, attachments will be saved to a directory instead of emailed $attach_save = FALSE; // SAVE ATTACHMENT PATH // Where files will be saved, if attach_save is enabled // ** Full path on server. Ex: /home/user/public_html/upload/ // ** Make sure directory has write permission // ** include trailing slash $attach_path = ''; // SHOW REQUIRED // If enabled, required fields are marked with an asterisk $show_required = TRUE; // SHOW URL // If enabled, the URL the script is running from will be added to the message $show_url = FALSE; // SHOW IP AND HOSTNAME // If enabled, the visitor's IP and hostname are added to the message $show_ip_hostname = TRUE; // SPECIAL FIELDS // These options help generate the email headers. Simply enter a field name, // and the user input from that field will be used. You can also combine fields. // For example, if you have a fm_firstname and fm_lastname field, you could // set $sender_name to 'fm_lastname, fm_firstname' $sender_name = 'fm_name'; $sender_email = 'fm_email'; $email_subject = 'Contact: fm_subject'; // MAX UPLOAD SIZE // If you are using file uploads in your form, this specifies the max file size. // (This does not override any server settings you might have in PHP.ini) $max_file_size = 1000000; // in bytes // MESSAGE STRUCTURE // This is an optional setting that allows you to define your own custom message // template. More information can be found on the web page. If left blank, the script // will generate the message itself, which is generally suitable for most purposes. // You use field names in this - they will be replaced with the user input from those fields. $message_structure = ''; // SUCCESS MESSAGE // This is the text shown after the visitor has successfully submitted the form. // You use field names in this - they will be replaced with the user input from those fields. $sent_message = '
Thank you - your message has been sent.
'; // AUTO REPLY OPTION // This optional feature allows you to automatically send a pre-defined auto reply email. // To use it, simply specify the name and email address you want the message to be 'from', // as well as a subject and message. To disable, just leave $auto_reply_message blank. // You use field names in the message - they will be replaced with the user input from those fields. $auto_reply_name = ''; $auto_reply_email = ''; $auto_reply_subject = ''; $auto_reply_message = ''; // IMAGE VERIFICATION // You can disable image verification, use the simple built-in method, or use ReCaptcha // If you use ReCaptcha, sign up for a free account at http://recaptcha.net and enter the codes below $verify_method = 'basic'; // 'off', 'basic', or 'recaptcha' // BASIC IMAGE VERIFICATION OPTIONS $verify_background = 'F0F0F0'; // hex code for background color $verify_text = '005ABE'; // hex code for text color $force_type = ''; // problems showing the code? try forcing to 'gif', 'jpeg' or 'png' // RECAPTCHA IMAGE VERIFICATION OPTIONS // Public and private keys - you get these when you sign up an account at http://recaptcha.net $re_public_key = ''; $re_private_key = ''; // SAVE DATA TO FILE // If set to TRUE, the form input will be saved in a delimited file $save_to_file = FALSE; // STILL SEND EMAIL // If saving the data to a file, still have the script send the email? $save_email = TRUE; // DATA PATH // The file that will be written to - make sure it has write access $save_path = 'data.txt'; // DELIMITER // Fields will be separated by this character. If this character is found in // the actual data, it will be removed. $save_delimiter = '|'; // NEWLINES // Newlines in the data will be replaced by this $save_newlines = "'; $gen .= ''; global $script_path; $i = strrpos($script_path, "/"); $tmp_path = substr($script_path, 0, $i); // $gen .= ''; $gen .= ''; $gen .='
' . "\n\n"; return $gen; } function ddfm_gen_text($item) { // type=text|class=|label=|fieldname=|max=|req=(TRUEFALSE)|[ver=]|[default=] global $form_submitted, $form_input, $show_required; $req_text = (($show_required) && ($item['req'] == 'true')) ? '' . DDFM_REQUIREDTAG . ' ' : ''; $gen = ""; $gen .= ''; $gen .= '
' . "\n\n"; return $gen; } function ddfm_gen_password($item) { // type=password|class=|label=|fieldname=|max=|req=(TRUEFALSE)|confirm=(TRUEFALSE) global $form_submitted, $form_input, $show_required; $req_text = (($show_required) && $item['req'] == 'true') ? '' . DDFM_REQUIREDTAG . ' ' : ''; $gen = ""; $gen .= '' . "\n"; $gen .= '
' . "\n\n"; if ($item['confirm'] == 'true') { // Duplicate field (add 'c' to end) $gen .= '' . "\n"; $gen .= '
' . "\n\n"; } return $gen; } function ddfm_gen_textarea($item) { // type=textarea|class=|label=|fieldname=|max=|rows=|req=(TRUEFALSE)|[default=] global $form_submitted, $form_input, $show_required; $req_text = (($show_required) && $item['req'] == 'true') ? '' . DDFM_REQUIREDTAG . ' ' : ''; $gen = ""; $gen .= '' . "\n"; $gen .= '
' . "\n\n"; return $gen; } function ddfm_gen_widetextarea($item) { // type=widetextarea|class=|label=|fieldname=|max=|rows=|req=(TRUEFALSE)|[default=] global $form_submitted, $form_input, $show_required; $req_text = (($show_required) && $item['req'] == 'true') ? '' . DDFM_REQUIREDTAG . ' ' : ''; $gen = ""; $gen .= '' . "\n"; $gen .= '
' . "\n\n"; return $gen; } function ddfm_gen_verify($item) { // type=verify|class=|label= global $verify_method, $show_required, $script_path; if ($verify_method != 'basic') return ''; $req_text = ($show_required) ? '' . DDFM_REQUIREDTAG . ' ' : ''; $gen = ""; if (ddfm_check_gd_support()) { $gen .= '' . "\n"; $gen .= '' . "\n"; $gen .= ''; $gen .= '
' . "\n\n"; } return $gen; } function ddfm_gen_fullblock($item) { // type=fullblock|class=|text= $gen = ""; $gen .= '' . "\n"; $gen .= $item['text'] . "\n"; $gen .= '
' . "\n"; $gen .= $item['text'] . "\n"; $gen .= '
' . "\n";
$item['data'] = str_replace(",,", "C0mM@", $item['data']);
$data = explode(",", trim($item['data']));
$data = str_replace("C0mM@", ",", $data);
for ($i = 0; $i < sizeof($data); $i+=4) {
$req_text = (($show_required) && ($data[$i+3] == 'true')) ? ' ' . DDFM_REQUIREDTAG . '' : '';
$gen .= '' . $data[$i + 1] . $req_text . '' . "\n";
$gen .= '
';
}
$gen .= '
' . "\n";
$c = 1;
$item['data'] = str_replace(",,", "C0mM@", $item['data']);
$data = explode(",", trim($item['data']));
$data = str_replace("C0mM@", ",", $data);
for ($i = 0; $i < sizeof($data); $i++) {
$gen .= '' . $data[$i] . '' . "\n";
$gen .= '
';
$c++;
}
$gen .= '
' . "\n"; $gen .= '' . DDFM_REQUIREDTAG . ' ' : ''; $gen = ""; $gen .= '
' . "\n\n"; return $gen; } // END of functions to show form output /* Generate the script output */ // convert $form_struct into array of strings $form_struct = (array)explode('*** ERROR - You have duplicate fieldnames in your form structure ***
'; } // Was form submitted? if (isset($_POST["form_submitted"])) { $form_submitted = TRUE; $mail_message = ""; $csv = ""; $orig_auto_reply_message = $auto_reply_message; $auto_reply_message = ''; // make correct encoding in auto - sokai - BEGIN $mime_boundary = md5(time()); $auto_reply_message .= '--' . $mime_boundary . PHP_EOL; $auto_reply_message .= 'Content-Type: text/plain; charset="utf-8"' . PHP_EOL; $auto_reply_message .= 'Content-Transfer-Encoding: 8bit' . PHP_EOL . PHP_EOL; // make correct encoding in auto - sokai - END $attached_files = array(); $attached_index = 0; $sel_recip = NULL; $message_structure = trim($message_structure); $auto_reply_message .= $orig_auto_reply_message; unset($errors); $errors = array(); if ($verify_method == 'recaptcha') { @include_once('recaptchalib.php'); $privatekey = $re_private_key; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { $errors[] = DDFM_INVALIDVER; } } // Get form input and put in array foreach ($_POST as $key => $i) { if ($key != "form_submitted") { if (!is_array($i)) { $form_input[strtolower($key)] = trim($i); } else { $form_input[strtolower($key)] = $i; } } } $msg_field_sep = ': '; $msg_field_line_end = "\n\n"; $fsindex = -1; // Validate input foreach ($form_struct as $fs) { if (!isset($form_input[$fs['fieldname']])) { $form_input[$fs['fieldname']] = ''; } $fsindex++; // check for fields used in vars if (isset($form_input[$fs['fieldname']])) { $sender_name = ddfm_str_replace($fs['fieldname'], ddfm_stripslashes($form_input[$fs['fieldname']]), $sender_name); $sender_email = ddfm_str_replace($fs['fieldname'], ddfm_stripslashes($form_input[$fs['fieldname']]), $sender_email); $email_subject = ddfm_str_replace($fs['fieldname'], ddfm_stripslashes($form_input[$fs['fieldname']]), $email_subject); } switch ($fs['type']) { case 'date': // type=date|class=|label=|fieldname=|req=(TRUEFALSE) $t = ddfm_stripslashes($form_input[$fs['fieldname']]); if ((strtolower($fs['req']) == 'true') && ($t == "")) { $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'"; } else if (ddfm_injection_chars($t)) { $errors[] = DDFM_INVALIDINPUT . " '" . $fs['label'] . "'"; } $csv .= str_replace($save_delimiter, ' ', $t) . $save_delimiter; $mail_message .= $fs['label'] . $msg_field_sep . $t . $msg_field_line_end; $message_structure = ddfm_str_replace($fs['fieldname'], $t, $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], $t, $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], ddfm_bsafe($t), $sent_message); break; case 'text': // type=text|class=|label=|fieldname=|max=|req=(TRUEFALSE)|[ver=]|[default=] $t = ddfm_stripslashes($form_input[$fs['fieldname']]); if ((strtolower($fs['req']) == 'true') && ($t == "")) { $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'"; } else if (strlen($t) > (int)$fs['max']) { $errors[] = $fs['max'] . ' ' . DDFM_MAXCHARLIMIT . " '" . $fs['label'] . "'"; } else if (ddfm_injection_chars($t)) { $errors[] = DDFM_INVALIDINPUT . " '" . $fs['label'] . "'"; } else if ((strtolower($fs['ver']) == 'email') && ((strtolower($fs['req']) == "true") || ($t != ""))) { if (!dd_is_valid_email($t)) $errors[] = DDFM_INVALIDEMAIL . " '" . $fs['label'] . "'"; } else if ((strtolower($fs['ver']) == 'url') && ((strtolower($fs['req']) == "true") || ($t != ""))) { if (!ddfm_is_valid_url($t)) $errors[] = DDFM_INVALIDURL . " '" . $fs['label'] . "'"; } $csv .= str_replace($save_delimiter, ' ', $t) . $save_delimiter; $mail_message .= $fs['label'] . $msg_field_sep . $t . $msg_field_line_end; $message_structure = ddfm_str_replace($fs['fieldname'], $t, $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], $t, $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], ddfm_bsafe($t), $sent_message); break; case 'password': // type=password|class=|label=|fieldname=|max=|req=(TRUEFALSE)|confirm=(TRUEFALSE) $t = ddfm_stripslashes($form_input[$fs['fieldname']]); if ((strtolower($fs['req']) == 'true') && ($t == "")) { $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'"; } else if (strlen($t) > (int)$fs['max']) { $errors[] = $fs['max'] . ' ' . DDFM_MAXCHARLIMIT . " '" . $fs['label'] . "'"; } else if (ddfm_injection_chars($t)) { $errors[] = DDFM_INVALIDINPUT . " '" . $fs['label'] . "'"; } else if (strtolower($fs['confirm']) == 'true') { $tc = ddfm_stripslashes($form_input[$fs['fieldname'] . 'c']); if ($t != $tc) $errors[] = DDFM_NOMATCH . " '" . $fs['label'] . "'"; } $csv .= str_replace($save_delimiter, ' ', $t) . $save_delimiter; $mail_message .= $fs['label'] . $msg_field_sep . $t . $msg_field_line_end; $message_structure = ddfm_str_replace($fs['fieldname'], $t, $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], $t, $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], ddfm_bsafe($t), $sent_message); break; case 'textarea': case 'widetextarea': // type=textarea|class=|label=|fieldname=|max=|rows=|req=(TRUEFALSE)|[default=] $t = ddfm_stripslashes($form_input[$fs['fieldname']]); if ((strtolower($fs['req']) == 'true') && ($t == "")) { $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'"; } else if (strlen($t) > (int)$fs['max']) { $errors[] = $fs['max'] . ' ' . DDFM_MAXCHARLIMIT . " '" . $fs['label'] . "'"; } $csv .= str_replace($save_delimiter, ' ', $t) . $save_delimiter; $mail_message .= $fs['label'] . $msg_field_sep . $t . $msg_field_line_end; $message_structure = ddfm_str_replace($fs['fieldname'], $t, $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], $t, $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], ddfm_bsafe($t), $sent_message); break; case 'verify': // type=verify|class=|label= if ($verify_method == 'basic') { $t = ddfm_stripslashes($form_input['fm_verify']); if ($t == "") { $errors[] = DDFM_MISSINGVER; } else if (trim($_COOKIE["ddfmcode"]) == "") { $errors[] = DDFM_NOVERGEN; } else if ($_COOKIE["ddfmcode"] != md5(strtoupper($t))) { $errors[] = DDFM_INVALIDVER; } } break; case 'checkbox': // type=checkbox|class=|label=|data= // (fieldname),(text),(CHECKED),(REQUIRED), // (fieldname),(text),(CHECKED),(REQUIRED), // (fieldname),(text),(CHECKED),(REQUIRED) // ### following three lines edited in order to have commas in the values, add by MG ### $fs['data'] = str_replace(",,", "C0mM@", $fs['data']); $data = explode(",", trim($fs['data'])); $data = str_replace("C0mM@", ",", $data); $tmp_msg = array(); $checkBoxChecked = false; //### added by MG ### for ($i = 0; $i < count($data); $i+=4) { $t = ''; if (isset($form_input[$data[$i]])) { $t = ddfm_stripslashes(trim($form_input[$data[$i]])); } if ((strtolower($data[$i+3]) == 'true') && ($t == "")) { $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'"; } if ($t != "") { $tmp_msg[] = $t; $checkBoxChecked = true; //### added by MG ### } $message_structure = ddfm_str_replace($data[$i], $t, $message_structure); $auto_reply_message = ddfm_str_replace($data[$i], $t, $auto_reply_message); $sent_message = ddfm_str_replace($data[$i], ddfm_bsafe($t), $sent_message); } // ### start of changes by MG ### if ((strtolower($fs['req']) == 'true') && !$checkBoxChecked) { $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'"; } // ### end of changes by MG ### $csv .= str_replace($save_delimiter, ' ', implode(', ', $tmp_msg)) . $save_delimiter; $mail_message .= $fs['label'] . $msg_field_sep . implode(', ', $tmp_msg) . $msg_field_line_end; break; case 'radio': // type=radio|class=|label=|fieldname=|req=|[default=]|data= // (text),(text),(text),(text) $t = ddfm_stripslashes(trim($form_input[$fs['fieldname']])); if ((strtolower($fs['req']) == 'true') && ($t == "")) { $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'"; } $csv .= str_replace($save_delimiter, ' ', $t) . $save_delimiter; $mail_message .= $fs['label'] . $msg_field_sep . $t . $msg_field_line_end; $message_structure = ddfm_str_replace($fs['fieldname'], $t, $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], $t, $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], ddfm_bsafe($t), $sent_message); break; case 'select': // type=select|class=|label=|fieldname=|multi=(TRUEFALSE)|data= // (#group),(text),(text),(#group),(text),(text) $data = explode(",", trim($fs['data'])); if (strtolower($fs['multi']) != 'true') { $t = ddfm_stripslashes($form_input[$fs['fieldname']]); $first_item = $data[0]; if ((strtolower($fs['req']) == 'true') && (($t == "") || ($t == $first_item))) { $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'"; } $csv .= str_replace($save_delimiter, ' ', $t) . $save_delimiter; $mail_message .= $fs['label'] . $msg_field_sep . $t . $msg_field_line_end; $message_structure = ddfm_str_replace($fs['fieldname'], $t, $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], $t, $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], ddfm_bsafe($t), $sent_message); } else { // multi = true $t = (array)$form_input[$fs['fieldname']]; if ((count($t) == 1) && ($t[0] == '')) { unset($t[0]); } if ((strtolower($fs['req']) == 'true') && (count($t) == 0)) { $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'"; } $tmp_msg = array(); foreach ($t as $tt) { if ($tt != "") $tmp_msg[] = $tt; } $csv .= str_replace($save_delimiter, ' ', implode(', ', $tmp_msg)) . $save_delimiter; $mail_message .= $fs['label'] . $msg_field_sep . implode(', ', $tmp_msg) . $msg_field_line_end; $message_structure = ddfm_str_replace($fs['fieldname'], implode(', ', $tmp_msg), $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], implode(', ', $tmp_msg), $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], ddfm_bsafe(implode(', ', $tmp_msg)), $sent_message); } break; case 'file': // type=file|class=|label=|fieldname=|[req=]|[allowed=1,2,3] if ((strtolower($fs['req']) == 'true') && (($_FILES[$fs['fieldname']]['name'] == ""))) { $errors[] = DDFM_MISSINGFILE . " '" . $fs['label'] . "'"; } $allowed = array(); if (trim($fs['allowed']) != "") { $allowed = (array)explode(",", trim(strtolower($fs['allowed']))); } if (($_FILES[$fs['fieldname']]['name'] != "") && ((int)$_FILES[$fs['fieldname']]['size'] == 0)) { $errors[] = DDFM_FILETOOBIG . ' ' . $_FILES[$fs['fieldname']]['name']; } else if ($_FILES[$fs['fieldname']]['tmp_name'] != "") { if (($_FILES[$fs['fieldname']]['error'] == UPLOAD_ERR_OK) && ($_FILES[$fs['fieldname']]['size'] > 0)) { $origfilename = $_FILES[$fs['fieldname']]['name']; $filename = explode(".", $_FILES[$fs['fieldname']]['name']); $filenameext = $filename[count($filename) - 1]; unset($filename[count($filename) - 1]); $filename = implode(".", $filename); $filename = substr($filename, 0, 15) . "." . $filenameext; $file_ext_allow = TRUE; if (count($allowed) > 0) { $file_ext_allow = FALSE; for ($x = 0; $x < count($allowed); $x++) { if (strtolower($filenameext) == strtolower($allowed[$x])) { $file_ext_allow = TRUE; } } } if ($file_ext_allow) { if((int)$_FILES[$fs['fieldname']]['size'] < $max_file_size) { $attached_files[$attached_index]['file'] = $_FILES[$fs['fieldname']]['name']; $attached_files[$attached_index]['tmpfile'] = $_FILES[$fs['fieldname']]['tmp_name']; $attached_files[$attached_index]['content_type'] = $_FILES[$fs['fieldname']]['type']; $attached_index++; $csv .= str_replace($save_delimiter, ' ', $_FILES[$fs['fieldname']]['name']) . $save_delimiter; if (!$attach_save) { $mail_message .= DDFM_ATTACHED . $msg_field_sep . $_FILES[$fs['fieldname']]['name'] . $msg_field_line_end; } else { $mail_message .= $fs['label'] . $msg_field_sep . $_FILES[$fs['fieldname']]['name'] . $msg_field_line_end; } $message_structure = ddfm_str_replace($fs['fieldname'], $_FILES[$fs['fieldname']]['name'], $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], $_FILES[$fs['fieldname']]['name'], $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], $_FILES[$fs['fieldname']]['name'], $sent_message); } else { $errors[] = DDFM_FILETOOBIG . ' ' . $_FILES[$fs['fieldname']]['name']; } } else { $errors[] = DDFM_INVALIDEXT . ' ' . $_FILES[$fs['fieldname']]['name']; } } else { $errors[] = DDFM_UPLOADERR . ' ' . $_FILES[$fs['fieldname']]['name']; } } /* handled above $csv .= str_replace($save_delimiter, ' ', $_FILES[$fs['fieldname']]['name']) . $save_delimiter; $mail_message .= $fs['label'] . $msg_field_sep . $_FILES[$fs['fieldname']]['name'] . $msg_field_line_end; $message_structure = ddfm_str_replace($fs['fieldname'], $_FILES[$fs['fieldname']]['name'], $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], $_FILES[$fs['fieldname']]['name'], $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], $_FILES[$fs['fieldname']]['name'], $sent_message); */ break; case 'selrecip': // type=selrecip|class=|label=|data=(select),User1,user1@domain.com,User2 etc.. $data = explode(",", trim($fs['data'])); $t = ddfm_stripslashes($form_input['fm_selrecip']); if (($t == "") || ($t == $data[0])) { $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'"; } else { for ($i = 1; $i < count($data); $i+=2) { if ($data[$i] == $t) { $sel_recip = trim($data[$i+1]); } } } break; } } // make sure no un-used fieldnames are left in template foreach ($form_struct as $fs) { $message_structure = ddfm_str_replace($fs['fieldname'], '', $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], '', $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], '', $sent_message); } if (ddfm_injection_chars($sender_name)) $errors[] = DDFM_INVALIDINPUT; if (ddfm_injection_chars($sender_email)) $errors[] = DDFM_INVALIDINPUT; if (ddfm_injection_chars($email_subject)) $errors[] = DDFM_INVALIDINPUT; if ($errors) { $o .= '