$value) : if (get_magic_quotes_gpc()) : $value = stripslashes($value); endif; $formstuff[$key] = strip_tags($value); endforeach; // check required fields are completed $formerror = FALSE; foreach ($req_fields AS $formlabel) : $value = trim($formstuff[$formlabel]); if (empty($value)) : $formerror = TRUE; endif; endforeach; if (!$formerror) : $error_msg = ""; if (has_newlines($formstuff['email']) || has_emailheaders($formstuff['cfemail']) || !is_valid($formstuff['email'])) : // email address is invalid $error_msg .= "\n"; endif; // if all clear, proceed with building and sending the email if (empty($error_msg)) : $message = ""; foreach ($formstuff AS $key => $value) : if ($key != 'cfsubmit') $message .= $key.": ".$value."\n\n"; endforeach; $message .= "\n\nSender Info:\n"; $message .= "IP: ".$_SERVER['REMOTE_ADDR']." http://ws.arin.net/whois/?queryinput=".$_SERVER['REMOTE_ADDR']."\n"; $message .= "Browser/OS: ".$_SERVER['HTTP_USER_AGENT']; $headers = "From: ".$formstuff['name']." <".$formstuff['email'].">\n"; $headers .= "Mime-Version: 1.0\n"; $headers .= "Content-Type: text/plain; charset=ISO-8859-1\n"; $headers .= "Content-Transfer-Encoding: 8bit\n"; $headers .= "Return-Path: <".$formstuff['email'].">\n"; $headers .= "Errors-To: ".$to_email; mail($to_email, $subject, $message, $headers); // Redirect to a thank you page echo "\n"; endif; else : $error_msg = "\n"; endif; endif; // function to print out form value, stripping any added backslashes function get_value ($formvalue) { if (!empty($_POST[$formvalue])) : if (get_magic_quotes_gpc()) : $form_value = stripslashes($_POST[$formvalue]); else : $form_value = $_POST[$formvalue]; endif; echo $form_value; endif; } ?> \n"; // perhaps style the warning class to a bright colour echo $error_msg; echo "\n"; endif; ?>

Privacy Policy