Файл: comment/send_mail.php
Строк: 320
<?
error_reporting(0);
include ("config.inc.php");
include ("../config.inc.php");
include("../leng.inc.php");
include ("../$yaz");
function cutty ($string)
{
$string = trim($string);
$string = stripslashes($string);
$string = str_replace ("<", "<", $string);
$string = str_replace (">", ">", $string);
$string = ereg_replace ('\"', """, $string);
$string = ereg_replace ("\'", """, $string);
$string = ereg_replace (""", """, $string);
$string = ereg_replace ("'", "'", $string);
$string = ereg_replace ("'", "`", $string);
$string = str_replace ("r", "", $string);
$string = str_replace ("n", "<br>", $string);
$string = str_replace ("%", "%", $string);
$string = str_replace ("!", "!", $string);
$string = str_replace ("^ +", "", $string);
$string = str_replace (" +$", "", $string);
$string = str_replace (":", ":", $string);
return ($string);
}
if (isset($name_) and $name_ != "") { setcookie("cooknamess",cutty($name_),time()+15552000);}
if (isset($mail_) and $mail_ != "") { setcookie("cookmailss",cutty($mail_),time()+15552000);}
if (isset($theme_) and $theme_ != "") {setcookie("cooktheme", str_replace ("<br>", "n", $theme_), time()+3600);}
if (isset($text_) and $text_ != "") {setcookie("cooktext", str_replace ("<br>", "n", $text_), time()+3600);}
if (!isset($send)):
if (!isset($cooknamess)) { $cooknamess = ""; }
if (!isset($cookmailss)) { $cookmailss = ""; }
if (!isset($name_) or $name_ == "") { $name_ = $cooknamess;}
if (!isset($mail_) or $mail_ == "") { $mail_ = $cookmailss;}
if (!isset($theme_) or $theme_ == "")
{
if (isset($_COOKIE['cooktheme'])&&$messref=="1")
{
$theme_ = $_COOKIE['cooktheme'];
$_COOKIE['cooktheme'] = "";
}
}
if (!isset($text_) or $text_ == "")
{
if (isset($_COOKIE['cooktext'])&&$messref=="1")
{
$text_ = $_COOKIE['cooktext'];
$_COOKIE['cooktext'] = "";
}
}
endif;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?=$title?> - <?=$leng_comment_sem[0];?></title>
<style type="text/css">
<!--
body
{
font-family: <?=$FONT?>;
font-size: <?=$FONTSIZE?>px;
scrollbar-face-color: <?=$DARK?>;
scrollbar-highlight-color: <?=$BORDER?>;
scrollbar-shadow-color: <?=$BORDER?>;
scrollbar-3dlight-color: <?=$BORDER?>;
scrollbar-arrow-color: <?=$BORDER?>;
scrollbar-track-color: <?=$DARK?>;
scrollbar-darkshadow-color: <?=$BORDER?>
}
.error {color: #FFFFFF; font-size: <?=$FONTSIZE+1?>px; font-weight:bold; font-family: <?=$FONT?>}
.textRed {color: #FF0000;}
.textBlue {color: #003399;}
a, a:link, a:visited, a:active {font-family: <?=$FONT?>; font-size: <?=$FONTSIZE?>px; color: <?=$LIGHTFONTLINK?>; font-weight: normal; text-decoration: none}
a:hover {font-family: <?=$FONT?>; font-size: <?=$FONTSIZE?>px; color: <?=$LIGHTFONTLINKHOVER?>; font-weight: normal; text-decoration: none}
a.mid:link, a.mid:visited, a.mid:active {font-family: <?=$FONT?>; font-size: <?=$FONTSIZE-1?>px; color: <?=$LIGHTFONTLINK?>; font-weight: normal; text-decoration: none}
a.mid:hover {font-family: <?=$FONT?>; font-size: <?=$FONTSIZE-1?>px; color: <?=$LIGHTFONTLINKHOVER?>; font-weight: normal; text-decoration: none}
.p {font-family: <?=$FONT?>; color: <?=$LIGHTFONTCOLOR?>; font-size: <?=$FONTSIZE?>px}
.pbig {font-family: <?=$FONT?>; color: <?=$LIGHTFONTCOLOR?>; font-size: <?=$FONTSIZE+2?>px}
.pmid {font-family: <?=$FONT?>; color: <?=$LIGHTFONTCOLOR?>; font-size: <?=$FONTSIZE-1?>px}
.psmall {font-family: <?=$FONT?>; color: <?=$LIGHTFONTCOLOR?>; font-size: <?=$FONTSIZE-2?>px}
a.dark:link, a.dark:visited, a.dark:active {font-family: <?=$FONT?>; font-size: <?=$FONTSIZE?>px; color: <?=$DARKFONTLINK?>; font-weight: normal; text-decoration: none}
a.dark:hover {font-family: <?=$FONT?>; font-size: <?=$FONTSIZE?>px; color: <?=$DARKFONTLINKHOVER?>; font-weight: normal; text-decoration: none}
.pdark {font-family: <?=$FONT?>; color: <?=$DARKFONTCOLOR?>; font-size: <?=$FONTSIZE?>px}
.pdarkhead {font-family: <?=$FONT?>; color: <?=$DARKFONTCOLOR?>; font-size: <?=$FONTSIZE+2?>px}
a.answ:link, a.answ:visited, a.answ:active {font-family: <?=$FONT?>; font-size: <?=$FONTSIZE?>px; color: <?=$ANSWFONTLINK?>; font-weight: normal; text-decoration: none}
a.answ:hover {font-family: <?=$FONT?>; font-size: <?=$FONTSIZE?>px; color: <?=$ANSWFONTLINKHOVER?>; font-weight: normal; text-decoration: none}
.pansw {font-family: <?=$FONT?>; color: <?=$ANSWFONTCOLOR?>; font-size: <?=$FONTSIZE?>px}
.panswbig {font-family: <?=$FONT?>; color: <?=$ANSWFONTCOLOR?>; font-size: <?=$FONTSIZE+2?>px}
textarea,input { font-family: <?=$FONT?>; font-size: <?=$FONTSIZE?>px; background: <?=$LIGHT?>; border: 1pt solid <?=$BORDER?>; color: <?=$FONT?> }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$leng_2_of_phpmailer;?>" />
<?
if (!isset($send))
{
?>
<script language="JavaScript">
<!--
function checkForm () {
var name = document.sendform.name.value;
var msg = document.sendform.text.value;
var mail = document.sendform.mail.value;
if(name=="") {
alert("<?=$leng_comment_sem[1];?>");
document.sendform.name.focus();
return false;
}
if(mail == "") {
alert("<?=$leng_comment_sem[2];?>");
document.sendform.mail.focus();
return false;
}
if(mail.indexOf('@',0) == -1 || mail.indexOf('.',0) == -1){
alert("<?=$leng_comment_sem[3];?>");
document.sendform.mail.value="";
document.sendform.mail.focus();
return false;
}
if(msg=="") {
alert("<?=$leng_comment_sem[4];?>");
document.sendform.text.focus();
return false;
}
return true;
}
//-->
</script>
</head>
<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" bgcolor=<?=$BACKGROUND?>>
<form id="sendform" name="sendform" method="post" action="" onSubmit="return checkForm();">
<label></label>
<table width="400" border="0" cellpadding="1" cellspacing="1" bgcolor=<?=$BORDER;?>>
<tr>
<td align="center" bgcolor=<?=$DARK;?> class="pdark"><strong><?=$leng_comment_sem[5];?> <? echo "<img src="mail.php?mm1=$mm1&mm2=$mm2" align="absmiddle"/>"; ?></strong></td>
</tr>
<tr>
<td bgcolor=<?=$LIGHT;?>><table width="100%" border="0" cellspacing="4" cellpadding="4">
<tr>
<td class=p><?=$leng_comment_sem[6];?><strong>*</strong>:
<input name="mm1" type="hidden" id="mm1" value="<?=$mm1?>" />
<input name="mm2" type="hidden" id="mm2" value="<?=$mm2?>" />
</td>
<td><input class=p name="name_" type="text" id="name" value="<?=htmlspecialchars(stripslashes($name_));?>" /></td>
</tr>
<tr>
<td class=p><?=$leng_comment_sem[7];?><strong>*</strong>: </td>
<td><input class=p name="mail_" type="text" id="mail" value="<?=htmlspecialchars(stripslashes($mail_));?>" /></td>
</tr>
<tr>
<td class=p><?=$leng_comment_sem[8];?> </td>
<td><input class=p name="theme_" type="text" id="theme" value="<?=htmlspecialchars(stripslashes($theme_));?>" /></td>
</tr>
<tr>
<td class=p><?=$leng_comment_sem[9];?><strong>*</strong>: </td>
<td><textarea class=p name="text_" cols="25" rows="6" id="text"><?=htmlspecialchars(stripslashes($text_));?></textarea></td>
</tr>
<tr>
<td colspan="2" class="p"><?=$leng_comment_sei[8];?></td>
</tr>
<tr>
<td> </td>
<td><input name="send" type="submit" class="p" id="send" style="width:125px;cursor:hand;" onmouseover="this.style.backgroundColor='<?=$DARK;?>';" onmouseout="this.style.backgroundColor='<?=$LIGHT;?>';" value="<?=$ssendd;?>"></td>
</tr>
</table></td>
</tr>
</table>
</form>
<?
}
else
{
$name = htmlspecialchars(stripslashes(trim($_POST['name_'])));
$mail_otprav = htmlspecialchars(stripslashes(trim($_POST['mail_'])));
$theme = htmlspecialchars(stripslashes(trim($_POST['theme_'])));
$text = htmlspecialchars(stripslashes(trim($_POST['text_'])));
$adresat = $_POST['mm2']."@".$_POST['mm1'];
$host = $_SERVER['HTTP_HOST'];
require("phpmailer/class.phpmailer.php");
$mail = new PHPMailer();
if($phpmailer_onoff==2)
{
$mail->IsSMTP();
$mail->Host = "$phpmailer_SMTP_server";
$mail->SMTPAuth = true;
$mail->Username = "$phpmailer_SMTP_username";
$mail->Password = "$phpmailer_SMTP_password";
}
elseif($phpmailer_onoff==1)
{
$mail->IsSendmail();
}
else
{
$mail->IsMail();
}
$mail->SetLanguage("$leng_2_of_phpmailer");
$mail->CharSet = "$kodirovka_of_phpmailer";
$mail->From = "$mail_otprav";
$mail->FromName = "$name";
$mail->AddAddress("$adresat","");
$mail->AddReplyTo("$mail_otprav","Info");
$mail->WordWrap = 50;
$mail->IsHTML(false);
$mail->Subject = "$theme";
$mail->Body = "$text";
$mail->AltBody = "$leng_comment_sem[10] $host";
if(!$mail->Send())
{
if (!($time_of_zaderjka==="-1") && $time_of_zaderjka>="0")
{
$ref_url=$PHP_SELF.'?mm1='.$mm1.'&mm2='.$mm2.'&messref=1';
echo "<META http-equiv="refresh" content="$time_of_zaderjka url=$ref_url">";
}
echo "$leng_comment_sem[11]<br>";
echo "<b><font color=red>$leng_comment_sem[12]</b><br> " . $mail->ErrorInfo . '</font>';
exit;
}
?>
</head>
<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" bgcolor=<?=$BACKGROUND?>>
<table width="400" height="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="<?=$BORDER;?>">
<tr>
<td align="center" bgcolor="<?=$DARK;?>" class="p2"><strong><?=$leng_comment_sem[13];?> </strong></td>
</tr>
<tr>
<td bgcolor="<?=$LIGHT;?>"><table width="100%" height="100%" border="0" cellpadding="4" cellspacing="4">
<tr>
<td height="100%" class="p"><p><?=$leng_comment_sem[14];?><br />
<img src="img/spacer.gif" alt="" width="1" height="175" /></p>
<p align="right"><a href="javascript:self.close()"><?=$leng_comment_sem[15];?> </a></p></td>
</tr>
</table></td>
</tr>
</table>
<?
}
?>
</body>
</html>