<?

//If (getenv("REMOTE_ADDR") == "127.0.0.6") {

// echo "<script> alert('Отказано в доступе!'); history.back(); </script>";

//}



If ($send == "ok") {



  If ($to == "" or $msg == "" or $name == "" or $email == "") {

   echo "<script> alert('Заполните все поля!'); history.back(); </script>";

   exit;

  }



  If (file_exists("users/$to") == true) {

   $ftm = fopen("mail/$to", "a");

   $name = str_replace("^","_",htmlspecialchars(stripslashes($name)));

   $email = str_replace("^","_",htmlspecialchars(stripslashes($email)));

   $msg = str_replace("\n","<br>",htmlspecialchars(stripslashes($msg)));

   $msg = str_replace("^","_",$msg);

   $msg = "Сообщение из раздела 'Обратная связь'<br>Отправитель: $name (<a href='mailto:$email'>$email</a>)<br>Его IP адрес: " . getenv("REMOTE_ADDR") . "<br>Текст сообщения:<br>$msg";



   fwrite($ftm, "0^$cl^" . date("d.m.Y H:i:s") . "^" . $msg . "\n");

   fclose($ftm);

  }



  echo "<script> alert('Сообщение успешно отправленно!'); </script>";

  //echo "<script> document.location.href='/my.php" . $idstr . "&com=mail'; </script>";

  //exit;



}

?>



<table border="0" width="100%" cellspacing="0" cellpadding="0">

  <tr>

    <td width="100%" bgcolor="#F0F0F0"><p><b>&gt;&gt; Обратная связь с продавцом</b></p></td>

  </tr>

</table>

<p>&nbsp;</p>



<table border="0" width="98%" cellspacing="0" cellpadding="4" bgcolor="#C0C0C0" align="center">

  <tr>

    <td width="2%" valign="middle" bgcolor="#F0F0F0" height="1" style="border-left: 1 solid #C0C0C0; border-top: 1 solid #C0C0C0; border-bottom: 1 solid #C0C0C0"><p align="center"><img border="0" src="img/pic_info.gif" width="16" height="16"></p></td>

    <td width="98%" bgcolor="#F0F0F0" height="1" style="border-right: 1 solid #C0C0C0; border-top: 1 solid #C0C0C0; border-bottom: 1 solid #C0C0C0"><p>В этом разделе Вы можете связаться с любым продавцом нашего сервиса по внутренней почте. Ответ продавца придет Вам на e-mail.</p></td>

  </tr>

</table>

<p>&nbsp;</p>





<table border="1" width="98%" cellpadding="0" align="center" style="border-collapse: collapse" bordercolor="#9ace8b" cellspacing="1">

  <tr>

    <td width="100%" valign="top">

      <table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="#F1FFED" style="border-collapse: collapse" bordercolor="#111111">

        <tr>

           <td width="100%" bgcolor="#9ACE8B"><p><b>Связь с продавцом...</b></p></td>

        </tr>

        <tr>

           <td width="100%" valign="top">

<p>&nbsp;</p>

<form method="POST" name="mailfrm" ACTION = "feedback.php">

<input type="hidden" name="send" value="ok">

 <div align="center">

   <center>

 <table border="1" width="600" cellspacing="0" cellpadding="0" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" height="34" style="border: 1px solid #F1FFED; ; border-collapse:collapse" bordercolor="#111111">

    <tr>

     <td width="175" bgcolor="#9ACE8B" height="19" bordercolorlight="#F1FFED" bordercolordark="#FFFFFF"><p>Ваше имя:</p></td>

     <td width="395" height="19" bgcolor="#F1FFED" bordercolor="#F1FFED"><p>

     <input type="text" name="name" size="24" style="font-family: Verdana, Arial; font-size: 8pt; border: 1px solid #9ACE8B; "></p></td>

    </tr>

    <tr>

     <td width="175" bgcolor="#9ACE8B" height="19" bordercolorlight="#F1FFED" bordercolordark="#FFFFFF"><p>Ваш e-mail:</p></td>

     <td width="395" height="19" bordercolor="#F1FFED"><p>

     <input type="text" name="email" size="24" style="font-family: Verdana, Arial; font-size: 8pt; border: 1px solid #9ACE8B; "></p></td>

    </tr>

    <tr>

     <td width="175" bgcolor="#9ACE8B" height="19" bordercolorlight="#F1FFED" bordercolordark="#FFFFFF"><p>Кому:</p></td>

     <td width="395" height="19" bordercolor="#F1FFED"><p>

     <input type="text" name="to" size="24" style="font-family: Verdana, Arial; font-size: 8pt; border: 1px solid #9ACE8B; "></p></td>

    </tr>

    <tr>

     <td width="175" bgcolor="#9ACE8B" height="19" bordercolorlight="#F1FFED" bordercolordark="#FFFFFF" valign="top"><p>Текст сообщения:</p></td>

     <td width="395" height="19" bordercolor="#F1FFED"><p>

     <textarea rows="6" name="msg" cols="65" style="font-family: Verdana, Arial; font-size: 8pt; border: 1px solid #9ACE8B; "></textarea></p></td>

    </tr>

    <tr>

     <td width="175" height="19" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" valign="top"></td>

     <td width="395" height="19" bordercolor="#F1FFED"><p>

     <input type="submit" name="B1" value="Отправить" style="border:1px solid #9ACE8B; font-family: Verdana, Arial; font-size: 8pt; background-color:#F1FFED"></p></td>

    </tr>

 </table>

   </center>

</div>

</form>



           </td>

        </tr>

      </table>

    </td>

  </tr>

</table>