//ВНИМАНИЕ!!!! СТРОКА session_start (); ДОЛЖНА ИДТИ В САМОМ НАЧАЛЕ ИСПОЛНЯЕМОГО ФАЙЛА session_start (); error_reporting(0); $top_level = "directions"; switch($top_level){ case("directions"): $top_menu_img1 = "images/page_header_top_menu_1on.gif"; $top_menu_img2 = "images/page_header_top_menu_2off+1.gif"; $top_menu_img3 = "images/page_header_top_menu_3off.gif"; $top_menu_img4 = "images/page_header_top_menu_4off.gif"; $top_menu_img5 = "images/page_header_top_menu_5off.gif"; $top_menu_img6 = "images/page_header_top_menu_6off.gif"; $top_menu_vignette = "images/page_header_vignette.gif"; break; case("about"): $top_menu_img1 = "images/page_header_top_menu_1off.gif"; $top_menu_img2 = "images/page_header_top_menu_2on.gif"; $top_menu_img3 = "images/page_header_top_menu_3off+1.gif"; $top_menu_img4 = "images/page_header_top_menu_4off.gif"; $top_menu_img5 = "images/page_header_top_menu_5off.gif"; $top_menu_img6 = "images/page_header_top_menu_6off.gif"; $top_menu_vignette = "images/page_header_vignette.gif"; break; case("events"): $top_menu_img1 = "images/page_header_top_menu_1off.gif"; $top_menu_img2 = "images/page_header_top_menu_2off.gif"; $top_menu_img3 = "images/page_header_top_menu_3on.gif"; $top_menu_img4 = "images/page_header_top_menu_4off+1.gif"; $top_menu_img5 = "images/page_header_top_menu_5off.gif"; $top_menu_img6 = "images/page_header_top_menu_6off.gif"; $top_menu_vignette = "images/page_header_vignette.gif"; break; case("press"): $top_menu_img1 = "images/page_header_top_menu_1off.gif"; $top_menu_img2 = "images/page_header_top_menu_2off.gif"; $top_menu_img3 = "images/page_header_top_menu_3off.gif"; $top_menu_img4 = "images/page_header_top_menu_4on.gif"; $top_menu_img5 = "images/page_header_top_menu_5off+1.gif"; $top_menu_img6 = "images/page_header_top_menu_6off.gif"; $top_menu_vignette = "images/page_header_vignette.gif"; break; case("awards"): $top_menu_img1 = "images/page_header_top_menu_1off.gif"; $top_menu_img2 = "images/page_header_top_menu_2off.gif"; $top_menu_img3 = "images/page_header_top_menu_3off.gif"; $top_menu_img4 = "images/page_header_top_menu_4off.gif"; $top_menu_img5 = "images/page_header_top_menu_5on.gif"; $top_menu_img6 = "images/page_header_top_menu_6off+1.gif"; $top_menu_vignette = "images/page_header_vignette.gif"; break; case("contacts"): $top_menu_img1 = "images/page_header_top_menu_1off.gif"; $top_menu_img2 = "images/page_header_top_menu_2off.gif"; $top_menu_img3 = "images/page_header_top_menu_3off.gif"; $top_menu_img4 = "images/page_header_top_menu_4off.gif"; $top_menu_img5 = "images/page_header_top_menu_5off.gif"; $top_menu_img6 = "images/page_header_top_menu_6on.gif"; $top_menu_vignette = "images/page_header_vignette_6on.gif"; break; } ?>
|
|
Контактная информация
Обратная связь
function show_form()
{
$_SESSION['code'] = rand(1000, 9999);
?>
* Помечены поля, которые необходимо заполнить
}
function complete_mail() {
if (empty($_POST['code']) or empty($_SESSION['code'])) {
echo 'Вы не указали код подтверждения'; $sendemail = 'No'; } elseif ($_POST['code'] != $_SESSION['code']) { echo ' Код подтверждения не совпадает'; $sendemail = 'No'; } $empty_input[] = 'Фамилия и имя:'; $empty_input[] = 'Ваш email:'; $empty_input[] = 'Текст сообщения:'; for ($i=0; $i '; $mess .= 'Ваш email: '.$_POST['input_name'][1].' '; $mess .= 'Текст сообщения: '.$_POST['input_name'][2].' '; // подключаем файл класса для отправки почты // если Вы забыли его скачать - http://www.php-mail.ru/class.phpmailer.zip require 'class.phpmailer.php'; $mail = new PHPMailer(); $mail->From = 'contacts@mcpi.ru'; // от кого email $mail->FromName = 'Cайт МЦПИ'; // от кого имя Cайт МЦПИ $mail->AddAddress('info@mcpi.ru', 'info@mcpi.ru'); // кому - адрес, Имя $mail->IsHTML(true); // выставляем формат письма HTML $mail->Subject = 'Письмо со страницы "контакты"'; // тема письма $mail->Body = $mess; // если был файл, то прикрепляем его к письму if(isset($_FILES['file_name'])) { if($_FILES['file_name']['error'][0] == 0){ $mail->AddAttachment($_FILES['file_name']['tmp_name'][0], $_FILES['file_name']['name'][0]); } } if($sendemail != 'No'){ // отправляем наше письмо if (!$mail->Send()) die ('Mailer Error: '.$mail->ErrorInfo); echo ' Спасибо! Ваше письмо отправлено. '; } } if (!empty($_POST['submit'])) complete_mail(); else show_form(); ?> |
|
|