$value) { $_POST["$key"] = stripslashes($value); } } if (strstr(php_uname(), 'Windows')) { $IS_WINDOWS = TRUE; } $auth = "*@www.murdok.org, *@www.murdok.org"; $deny = "nobody@*, anonymous@*, postmaster@*"; function array_trim(&$value, $key) { $value = trim($value); } function get_domain($string) { if (eregi('\.?([a-zA-Z0-9\-]+\.?[a-zA-Z0-9\-]+)$', $string, $values)) { return $values[1]; } return NULL; } function error_msg($error, $required = FALSE) { global $post; if (!empty($post['missing_fields_redirect']) && $required) { header('Location: ' . $post['missing_fields_redirect']); } elseif (!empty($post['error_redirect'])) { header('Location: ' . $post['error_redirect']); } else { echo "\r\n"; echo "\t
\r\n"; echo "\t\tForm Error\r\n"; echo "\t\t* {font-family: \"Verdana\", \"Arial\", \"Helvetica\", monospace;}\r\n"; echo "\t\r\n"; echo "\t\r\n"; echo "\t\t${error}
\r\n\t\t« go back
\r\n"; echo "\t\r\n"; echo "\r\n"; } exit(); } function pattern_grep($input, $array) { foreach ($array as $value) { $value = addcslashes($value, '^.[]$()|{}\\'); $value = str_replace('*', '.*', $value); $value = str_replace('?', '.?', $value); $value = str_replace('+', '.+', $value); if (eregi('^' . $value . '$', $input)) { return TRUE; } } return FALSE; } if ($_SERVER['REQUEST_METHOD'] == 'POST') { $post = array( 'email' => $_POST['email'], 'subject' => $_POST['subject'], 'realname' => $_POST['realname'], 'Article_content' => $_POST['Article_content'], 'Author_Bio' => $_POST['authbio'], #'required' => $_POST['required'], #'env_report' => $_POST['env_report'], 'sort' => $_POST['sort'], 'redirect' => $_POST['redirect'], 'error_redirect' => $_POST['error_redirect'], 'missing_fields_redirect' => $_POST['missing_fields_redirect'] ); if (isset($must['required'])) { $post['required'] = $must['required'] . ',' . $_POST['required']; } if (($auth = explode(',', $auth))) { array_walk($auth, 'array_trim'); } if (($deny = explode(',', $deny))) { array_walk($deny, 'array_trim'); } if ((!empty($post['required'])) && ($list = explode(',', $post['required']))) { $list[] = 'recipient'; $list[] = 'email'; array_walk($list, 'array_trim'); foreach ($list as $value) { if (!empty($value) && empty($_POST["$value"])) { error_msg("You have left a required field blank.", TRUE); } } } if (pattern_grep($post['email'], $deny)) { error_msg("You have specified a banned email address."); } if (!eregi('^([a-zA-Z0-9\.\_\-]+)\@((([a-zA-Z0-9\-]+)\.)+([a-zA-Z]+))$', $post['email'])) { error_msg("You have specified an invalid email address."); } if ((!empty($post['sort'])) && ($list = explode(',', $post['sort']))) { array_walk($list, 'array_trim'); foreach ($list as $value) { $form["$value"] = $_POST["$value"]; } } else { $form = $_POST; } $subject = empty($post['subject']) ? "" : "" . $post['subject']; $message = "Article Submitted By: " . $post['realname'] . " - " . $post['email'] . " - " . date('l, F jS, Y @ g:i:s a (O)') . "\r\n\r\n"; $message .= "Blog Partner Information\r\n"; $message .= "======================================================================\r\n"; $message .= $post['realname']; $message .= "\r\n"; $message .= $post['email']; $message .= "\r\n\r\n"; $message .= "Blog URL:\r\n"; $message .= $_POST['website']; $message .= "\r\n\r\n"; $message .= "Photo:\r\n"; $message .= $_POST['photo']; $message .= "\r\n\r\n"; $message .= "Author Bio:\r\n"; $message .= $_POST['authbio']; $message .= "\r\n\r\n"; $message .= "Blog Description:\r\n"; $message .= $_POST['about']; $message .= "\r\n\r\n"; $message .= "======================================================================\r\n"; $message .= "Blog Title:\r\n"; $message .= $_POST['Article_title']; $message .= "\r\n\r\n"; $message .= "Comments:\r\n"; $message .= $_POST['Article_content']; $message .= "\r\n"; $message .= "======================================================================"; if (mail('blogpartner@www.murdok.org,dave.hensley@Murdokinc.com', $subject, $message, "From: blogpartner@www.murdok.org\r\nReply-To: " . $post['email'] . "\r\nX-Mailer: PHP FormMail")) { if (!empty($post['redirect'])) { header('Location: ' . $post['redirect']); } } else { error_msg("There was an unknown error while sending email."); } } else { error_msg("Invalid request method used."); } ?> The www.murdok.org editorial staff will now review your submission and you may be contacted at your email address: .If you have any further questions, please contact submit@www.murdok.org and someone will be in contact with you shortly.
No comments yet. Be the first to comment!