![Nikitoz01](/images/avatars/user_314.jpeg)
Nikitoz01
Продвинутый
![Продвинутый](/images/rank3.gif)
Дата регистрации:
06.10.2011 20:01:29
Сообщений: 40
<?php
include('kcaptcha/kcaptcha.php');
session_start();
require_once("config.php"
![](/images/smiles/sm3.png)
if ($_POST['act']== "y"
![](/images/smiles/sm3.png)
{
if(isset($_SESSION['captcha_keystring']) && $_SESSION['captcha_keystring'] == $_POST['keystring'])
{
if (isset($_POST['posName']) && $_POST['posName'] == ""
![](/images/smiles/sm3.png)
{
$statusError = "$errors_name";
}
elseif (isset($_POST['posEmail']) && $_POST['posEmail'] == ""
![](/images/smiles/sm3.png)
{
$statusError = "$errors_mailfrom";
}
elseif(isset($_POST['posEmail']) && !preg_match("/^([a-z,._,0-9])+@([a-z,._,0-9])+(.([a-z])+)+$/", $_POST['posEmail']))
{
$statusError = "$errors_incorrect";
unset($_POST['posEmail']);
}
elseif (isset($_POST['posRegard']) && $_POST['posRegard'] == ""
![](/images/smiles/sm3.png)
{
$statusError = "$errors_subject";
}
elseif (isset($_POST['posText']) && $_POST['posText'] == ""
![](/images/smiles/sm3.png)
{
$statusError = "$errors_message";
}
elseif (!empty($_POST))
{
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: $content charset=$charset\r\n";
$headers .= "Date: ".date("Y-m-d (H:i:s)",time())."\r\n";
$headers .= "From: \"".$_POST['posName']."\" <".$_POST['posEmail'].">\r\n";
$headers .= "X-Mailer: My Send E-mail\r\n";
mail($mailto,$subject,$message,$headers);
unset($name, $posText, $mailto, $subject, $posRegard, $message);
$statusSuccess = "$send";
}
}else{
$statusError = "$captcha_error";
unset($_SESSION['captcha_keystring']);
}
}
?>
<html>
<head>
<title>meny</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251"/>
<!--[if IE]>
<link rel="stylesheet" href="ie.css" type="text/css" media="screen"/>
<![endif]-->
<![if !IE ]>
<link rel="stylesheet" type="text/css" href="brauzer.css" />
<![endif]>
<link rel="stylesheet" type="text/css" href="cssverticalmenu.css" />
</head>
<body bgcolor="#e3e7da" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" background="images/fon.jpg">
<tr>
<td width="349"><img src="images/3.gif" width="172" height="120" /></td>
<td width="657"></td>
<td width="265" align="right"><img src="images/5.gif" width="168" height="120" /></td>
</tr>
<tr>
<td colspan="3">
<ul id="menu010">
<li><a href="index.htm">Главная</a></li>
<li><a href="book.php" >Гостевая книга</a></li>
<li><a href="#">История</a></li>
<li><a href="galery.html">Галерея</a></li>
<li><a href="#">Обратная связь</a></li>
</ul>
</td>
</tr>
</table>
<table border="0" >
<tr>
<td><table border="1" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
</td>
<td><p align="center"><h2>Oбpaтнaя cвязь</h2>
<p id="emailSuccess">
<strong style="color:green;"><?php echo "$statusSuccess" ?></strong>
</p>
<p id="emailError"><strong style="color:red;"><?php echo "$statusError" ?></strong></p>
<div id="contactFormArea">
<form action="'/" method="post" id="cForm">
<input type="hidden" name="act" value="y" />
<fieldset>
<label for="posName"><b>Ваше имя:</b></label>
<input class="text" type="text" size="25" name="posName" id="posName" />
<label for="posEmail"><b>Ваш E-mail адрес:</b></label>
<input class="text" type="text" size="25" name="posEmail" id="posEmail" />
<label for="posRegard"><b>Тема сообщения:</b></label>
<input class="text" type="text" size="25" name="posRegard" id="posRegard" />
<label for="posText"><b>Сообщение:</b></label>
<textarea cols="50" rows="20" name="posText" id="posText"></textarea>
<label for="posCaptcha"><center><b>Текст на изображении (цифры)</b>:</label><a href='readme.html'><img src="kcaptcha?<?php echo session_name()?>=<?php echo session_id()?>" border=0></a></center><input class="text" type="text" size="25" name="keystring" id="keystring" />
<br><br><label><input class="submit" type="submit" name="selfCC" id="selfCC" value=" Отправить " /></label>
</fieldset>
<?php include 'kcaptcha/kcaptcha_rand.php' ?>
</form>
</div>
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
P.S. мне казалось что надо что-то указать в action свой почтовый адрес, но у меня ничего не вышло
![](/images/smiles/sm1.png)