readDB('mngrUSER',$datas); $ret = substr($ret,strpos($ret,"")+strlen(""),strlen($ret)-strlen("")); $ret = substr($ret,0,strpos($ret,"")); $arrRET = explode ("|",$ret); if (count($arrRET[1]) > 0) { $arrUSER = explode ("}{",$arrRET[1]); if ($arrUSER[2] == $_SESSION['name']) { if ( $arrUSER[5] != "" ) {$From = $arrUSER[2]." <".$arrUSER[5].">"; } else {$From = $arrUSER[2]." <".getip().">"; } $mail_body = $_POST['usrTEXT']; $TO = "office@tvhall.tv"; $mailTO = "TVHALL"." "; $subject = "от абонента сайта ТВХОЛЛ"; $header = "From: ".$From. "\r\n"; //. "\nContent-Type: text/html; charset=utf-8"; $mail_body = iconv("utf-8", 'KOI8-R', $mail_body); $subject = iconv("utf-8", "windows-1251", $subject); $header = iconv("utf-8" ,"windows-1251", $header); // "windows-1251" mail($mailTO, $subject, $mail_body, $header); // $mailTO $arFLTR['MAIL'] echo genREQUST ("sended"); } } else { echo genREQUST ("user"); } } else { echo genREQUST ("captcha"); } } //----------------------------------- function genREQUST ($err) { $txtHTML1 = '

ТЕКСТ письма:

'; switch ($err) { case "captcha": $txtHTMLerr = "

ошибка ввода подтверждения!!!

";break; case "user": $txtHTMLerr = "

Вы НЕ авторизованы или НЕ зарегистрированы!!!

";break; case "sended": $txtHTMLerr = "

ПИСЬМО ОТПРАВЛЕНО!!!

";break; case "start": $txtHTMLerr = ""; break; } $txtHTML2 = '

Подтвердите кодом с картинки





'; return $txtHTML1.$txtHTMLerr.$txtHTML2 ; } //---------------------------------------------------------------------------------- function getip() { if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"),"unknown")) $ip = getenv("HTTP_CLIENT_IP"); elseif (getenv("HTTP_X_FORWARDED_FOR") && strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown")) $ip = getenv("HTTP_X_FORWARDED_FOR"); elseif (getenv("REMOTE_ADDR") && strcasecmp(getenv("REMOTE_ADDR"), "unknown")) $ip = getenv("REMOTE_ADDR"); elseif (!empty($_SERVER['REMOTE_ADDR']) && strcasecmp($_SERVER['REMOTE_ADDR'], "unknown")) $ip = $_SERVER['REMOTE_ADDR']; else $ip = "unknown"; return($ip); } ?>