File: /var/www/likoholding/old.liko-holding.com.ua/new/contacts.php
<?php
include ("blocks/db.php"); /* соединение с базой */
include ("blocks/parts/query.php");
//Если форма отправлена
if(isset($_POST['submit'])) {
//Проверка Поля ИМЯ
if(trim($_POST['contactname']) == '') {
$hasError = true;
} else {
$name = trim($_POST['contactname']);
}
//Проверка поля ТЕМА
if(trim($_POST['subject']) == '') {
$hasError = true;
} else {
$subject = trim($_POST['subject']);
}
//Проверка правильности ввода EMAIL
if(trim($_POST['email']) == '') {
$hasError = true;
} else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", trim($_POST['email']))) {
$hasError = true;
} else {
$email = trim($_POST['email']);
}
//Проверка наличия ТЕКСТА сообщения
if(trim($_POST['message']) == '') {
$hasError = true;
} else {
if(function_exists('stripslashes')) {
$comments = stripslashes(trim($_POST['message']));
} else {
$comments = trim($_POST['message']);
}
}
//Если ошибок нет, отправить email
if(!isset($hasError)) {
$emailTo = 'takhir.berdyyev@gmail.com'; //Сюда введите Ваш email
$body = "Отправитель: $name \nКонтактный Email: $email \nТема Сообщения: $subject \n\nСообщение:\n $comments";
$headers = 'From: liko-holding.com.ua- <'.$emailTo.'>' . "\r\n" . 'Reply-To: ' . $email;
mail($emailTo, $subject, $body, $headers);
$emailSent = true;
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<head>
<title>Лико холдинг</title>
<!-- Скрипты и стили -->
<?php include ("blocks/head.php") ?>
<link rel="stylesheet" href="css/news_page.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/contacts.css" type="text/css" media="screen" />
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="/jsjquery.validate.pack.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#contactform").validate();
});
</script>
</head>
<body>
<div id="all">
<!-- Шапка сайта, слайдер, главное меню -->
<?php include ("blocks/parts/header.php") ?>
<div id="main">
<div id="left_side">
<h1>Зворотній зв'язок</h1>
<!--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--->
<div id="contact-wrapper">
<?php if(isset($hasError)) { //Если найдены ошибки ?>
<p class="error">Перевірте, будь ласка, правильність заповнення всіх полів.</p>
<?php } ?>
<?php if(isset($emailSent) && $emailSent == true) { //Если письмо отправленл ?>
<p><strong>Ваше повідомлення успішно відправлено!</strong></p>
<p>Дякуємо <strong><?php echo $name;?></strong> за відправлене повідомлення. Ми зв'яжемося з вами у найкоротший термін.</p>
<?php } ?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" id="contactform">
<div>
<label for="name"><strong>Ваше ім'я:</strong></label>
<input type="text" size="50" name="contactname" id="contactname" value="" />
</div>
<div>
<label for="email"><strong>Ваш контактний Email:</strong></label>
<input type="text" size="50" name="email" id="email" value="" />
</div>
<div>
<label for="subject"><strong>Тема повідомлення:</strong></label>
<input type="text" size="50" name="subject" id="subject" value="" />
</div>
<div>
<label for="message"><strong>Текст повідомлення:</strong></label>
<textarea rows="5" cols="50" name="message" id="message"></textarea>
</div>
<input type="submit" value="Відправити повідомлення" name="submit" />
</form>
</div>
<!--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--->
</div>
<div id="right_side">
<!-- Боковой слайдер -->
<?php include ("blocks/parts/gallery_side.php") ?>
<!-- Правый баннер -->
<?php include ("blocks/parts/banner_right.php") ?>
<!-- Баннер Реализованные проекты -->
<?php include ("blocks/parts/banner_projects.php") ?>
<!-- Баннер Реализованные Социальные программы -->
<?php include ("blocks/parts/banner_social.php") ?>
<!-- Баннер Реализованные Финансовые предложения -->
<?php include ("blocks/parts/banner_finance.php") ?>
<!-- Баннер Реализованные Финансовые предложения -->
<?php include ("blocks/parts/banner_flats.php") ?>
<!-- Баннер Блог Яблонского -->
<?php include ("blocks/parts/banner_blog.php") ?>
</div>
</div>
<div id="footer_menu_wrapper">
<div id="footer_menu"><?php include ("blocks/footer_menu.php") ?></div>
</div>
<div id="copyright">© copyright 2011 likoholding</div>
</div>
</body>
</html>