V
Vinils
Пожалуйста помогите в данный код поместить функцию добавления файла к письму:
<?php
// BOF: BugFix: Spam mailer exploit
$sanita = array("|([\r\n])[\s]+|","@Content-Type");
$HTTP_POST_VARS['email'] = $_POST['email'] = preg_replace( $sanita, " ", $_POST['email'] );
$HTTP_POST_VARS['name'] = $_POST['name'] = preg_replace( $sanita, " ", $_POST['name'] );
// EOF: BugFix: Spam mailer exploit
$error = false;
if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {
$name = tep_db_prepare_input($HTTP_POST_VARS['name']);
$email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);
$enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
if (tep_validate_email($email_address)) {
if (CONTACT_US_LIST !=''){
$send_to_array=explode("," ,CONTACT_US_LIST);
preg_match('/\<[^>]+\>/', $send_to_array[$send_to], $send_email_array);
$send_to_email= eregi_replace (">", "", $send_email_array[0]);
$send_to_email= eregi_replace ("<", "", $send_to_email);
tep_mail(preg_replace('/\<[^*]*/', '', $send_to_array[$send_to]), $send_to_email, EMAIL_SUBJECT, $enquiry, $name, $email_address);
}else{
tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);
}
tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
} else {
$error = true;
$messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
}
}
$enquiry = "";
$name = "";
$email = "";
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US));
$content = CONTENT_CONTACT_US;
?>
<?php
// BOF: BugFix: Spam mailer exploit
$sanita = array("|([\r\n])[\s]+|","@Content-Type");
$HTTP_POST_VARS['email'] = $_POST['email'] = preg_replace( $sanita, " ", $_POST['email'] );
$HTTP_POST_VARS['name'] = $_POST['name'] = preg_replace( $sanita, " ", $_POST['name'] );
// EOF: BugFix: Spam mailer exploit
$error = false;
if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {
$name = tep_db_prepare_input($HTTP_POST_VARS['name']);
$email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);
$enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
if (tep_validate_email($email_address)) {
if (CONTACT_US_LIST !=''){
$send_to_array=explode("," ,CONTACT_US_LIST);
preg_match('/\<[^>]+\>/', $send_to_array[$send_to], $send_email_array);
$send_to_email= eregi_replace (">", "", $send_email_array[0]);
$send_to_email= eregi_replace ("<", "", $send_to_email);
tep_mail(preg_replace('/\<[^*]*/', '', $send_to_array[$send_to]), $send_to_email, EMAIL_SUBJECT, $enquiry, $name, $email_address);
}else{
tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);
}
tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
} else {
$error = true;
$messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
}
}
$enquiry = "";
$name = "";
$email = "";
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US));
$content = CONTENT_CONTACT_US;
?>