Просмотр файла partner/admin/mail.php

Размер файла: 2.06Kb
<?php
Error_Reporting(E_ALL & ~E_NOTICE);
Error_Reporting (ERROR | WARNING);

session_name("SESID");
session_start();

include ("../config.php");

if($apass==$_SESSION[apass]){
if(empty($_GET[act]))
{
include ("../themes/$themes.php");


$for = htmlspecialchars(stripslashes($_GET["for"]));
$to = htmlspecialchars(stripslashes($_GET["to"]));


echo "<p align=\"center\">Отправка e-mail сообщения</p>";
if(!empty($_GET[err]))
{
if (preg_match("([А-Яа-я<br />])", "$_GET[err]"))
{
echo "<p><font color=\"red\">$_GET[err]</font><br /><br /></p>";
}
}
echo "<form method=\"post\" action=\"mail.php?act=send \">";
echo "<p>*Кому";
echo "<br /><input type=\"text\" name=\"mail\" maxlength=\"50\" value=\"$to\"/><br />";
echo "Тема";
echo "<br /><input type=\"text\" name=\"tema\" maxlength=\"50\" value=\"\"/><br />";
echo "Ваш e-mail";
echo "<br /><input type=\"text\" name=\"email\" value=\"\"/>";
echo "<br />*Сообщение<br />";
echo "<textarea rows=\"5\" cols=\"15\" name=\"msg\"></textarea><br /><br />
<br />";
echo "<input type=\"submit\" name=\"do\" value=\"Отправить\"/></p></form>";

echo "<p>* - поля, обязательные для заполнения<br />
";
include ("../templates/foot.php");
}
if($_GET[act] == "send")
{
if(empty($_POST[mail]))
{
$err = "Не введено Кому<br />";
}
if(empty($_POST[msg]))
{
$err .= "Не введено сообщение<br />";
}
if(!empty($err))
{
header ("Location: mail.php?err=$err");
}
if(empty($err))
{
if(empty($_POST[email]))
{
$email = "[email protected]";
}
else
{
$email = "$_POST[email]";
}
$msg=htmlspecialchars(stripslashes($_POST[msg]));
$tema=htmlspecialchars(stripslashes($_POST[tema]));
$headers="Content-Type: text/html; charset=utf-8\n";
$headers.="From: $email\nX-Mailer: PHP v.".phpversion();
mail($_POST[mail], $tema, $msg, $headers);
header ("Location: index.php?mail=1");
}}}else{
include ("../themes/$themes.php");

echo'пошел на хуй';
include ("../templates/foot.php");

}

?>