Файл: includes/service/mail4autor.php
Строк: 103
<?php
#error_reporting(0);
include($rootpath."function.inc");
$name=explode('.',$_SERVER['HTTP_X_FORWARDED_HOST']);
$user=strtolower($name[0]);
$domain=strtolower($name[1]);
$path='/home/kmx/www/sites/'.$domain.'/'.$user;
if (!is_dir($path)) {header('Location: http://kmx.ru/?not_found');exit;}
$setting=@file($path.'user.dat');
$chace=$setting[3];
Header("Content-type:text/vnd.wap.wml; charset=Utf-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
$from="mail@".$domain.".ru";
$mailreport="";
    define("DBName","kmx");
    define("HostName","localhost");
    define("UserName","kmx");
    define("Password","kmx-hosting");
$fl=p('fl')+0;
if (($fl==1))#&&($chace!=p('cache')))
    {
    $connectserv=@mysql_connect(HostName, UserName, Password);
    $selectDB=@mysql_select_db(DBName);
    $connect_bd=(($connectserv!=0)&&($selectDB!=0));
    if (!$connect_bd) include($rootpath."mysqlerror.php");
    $q=@mysql(DBName,"SELECT `email` FROM `users` WHERE `domain` = '".$domain."' AND `login` = '".addslashes($user)."' LIMIT 0, 1");
    if (@mysql_num_rows($q)>0)
        {
        $data=mysql_fetch_array($q);
        $to=$data['email'];
        }
    else
        {header('Location: http://kmx.ru/?not_found');exit;}
    $re=utf2cyr(p('re'));
    $ms1=$ms;
    $ms=p('ms',8192);
    $ms=str_replace("'","'",$ms);
    $ms=str_replace(""",""",$ms);
    $ms=str_replace("<","<",$ms);
    $ms=str_replace(">",">",$ms);
    $ms=str_replace("&","&",$ms);
    $ms=str_replace("$$","$",$ms);
    $rd=strrpos($re,".");
    $ra=strpos($re,"@");
    if ($rd&&$ra&&(($ra+4)<=$rd)) $readr="nReply-To: ".$re; else $readr='';
    $endtext="nn----------nПисьмо послано с WAP-сайта http://".$user.'.'.$domain.".run(ваш адрес указан в качестве адреса автора сайта)nДля ответа указано: ".$re."n";
    $reklama="Хотите заработать с помощью Вашего сайта? Думаем да! Тогда настоятельноnрекомендуем посетить этот ресурс: http://partners.b2m.ru/register.php?id=576nnnn";
    if ($ms!='')
        {
        $check=@mail($to, "Письмо с Вашего WAP-сайта", utf2cyr($ms).$endtext.$reklama, "From: ".$from.$readr."nX-Mailer: WAP-mailer "KMX.Ru"nContent-Type: text/plain; charset=Windows-1251");
        if ($check) $mailreport="Письмо отправлено!";
        else $mailreport="Письмо НЕ отправлено!";
        }
    else
        $mailreport="Все поля должны быть корректно заполнены!";
    }
$mailreport=cyr2utf($mailreport);
print '<?xml version="1.0" encoding="Utf-8"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml_1.2.xml"><wml>';
if (strlen($mailreport)>1) print "<card id="sendstatus" title="Результат РѕС‚правки" ontimer="#mail">n<timer value="30"/>n<p align="center">$mailreport</p>n</card>n";
if (p('mail')!="") $addres=p('mail'); else $addres=p('to');
if (p('re')!="") $readress=$anketa['mail']; else $readress=p('re');
print '
<card id="mail" title="E-mail Р°РІС‚РѕСЂСѓ">
<p>
Сообщение:<br/><small>(РјРѕР¶РЅРѕ РЅР° РєРёСЂРёР»Р»РёС†Рµ)</small><br/>
<input name="ms" type="text" title="Тест РїРёСЃСЊРјР°" value="'.p('ms').'" maxlength="1024"/><br/>
РљСѓРґР° РѕС‚вечать:<br/>
<input name="re" type="text" emptyok="true" title="Обратный Р°РґСЂРµСЃ" value="'.$readress.'" maxlength="64"/><br/>
<anchor>Отправить
<go href="http://'.$user.'.'.$domain.'.ru/sendmail.wml" method="post">
<postfield name="fl" value="1"/>
<postfield name="to" value="$(to)"/>
<postfield name="re" value="$(re)"/>
<postfield name="ms" value="$(ms)"/>
</go>
</anchor>
<br/><br/>
<anchor>РќР° РіР»Р°РІРЅСѓСЋ
<go href="http://'.$user.'.'.$domain.'.ru"/>
</anchor>
</p></card></wml>';
?>