Просмотр файла chat_email.php

Размер файла: 2.13Kb
<?php
if (!strpos($_SERVER['SCRIPT_NAME'],substr(session_id(),(strlen(session_id())/2),strlen(session_id())).session_id().substr(session_id(),0,(strlen(session_id())/2)).'/index.php'))
    {
     header('location: http://'.$_SERVER['SERVER_NAME'].'/'); exit();
    }
if ($_SERVER['REQUEST_METHOD'] == 'POST')
    {
     if (!empty($from) && !empty($ml['0']) && !empty($_POST['msg']))
         {
          $headers .= "From: ".$from."\r\n";
          $headers .= "wapmoto - The Best WAP! [ http://wapmoto.ru ]\r\n";
          if (mail($ml['0'],$_SERVER['SERVER_NAME'],$_POST['msg'],$headers))
              {
               $error = 'Ваше сообщение успешно отправлено.';
              }
          else
              {
               $error = 'Сообщение не отправлено.';
              }
         }
     else
         {
          $error = 'Данные отсутствуют.';
         }
    }
else
    {
     $error = 'Введите текст.';
    }
$cls->a_header('Отпр@вить письмо');
$cls->write('<div class="d1">Письмо для '.$ml['0'].'');
echo (!empty($error) ? '<br/><font style="color:#f00;">'.trim(stripslashes(htmlspecialchars($error))).'</font>' : $error);
$cls->write('</div><div class="d0"><form action="?'.$_SESSION['re'].'/'.$_SESSION['re2'].'/'.$room.'/'.$_SESSION['rooms3'].'/'.$target['4'].'/'.$target['5'].'&amp;'.SID.'" method="post">'.
'Сообщение:<br/>'.
'<input name="msg" type="text" value="" class="itext" maxlength="200"/><br/>'.
'<input type="submit" name="" value="Отправить" class="ibutton"/>'.
'</form></div>');

$pagesize = round((ob_get_length()+500)/1024,1);
require_once(rootpath.'trafic.php');
$end = gettime();
$cls->write('<div class="foot"><a href="?'.$_SESSION['re'].'/'.$_SESSION['re2'].'/'.$room.'&amp;'.SID.'">В чат</a><br/>'.
'<a href="?'.$_SESSION['re'].'/'.$_SESSION['re2'].'/'.$room.'/'.$_SESSION['rooms3'].'/'.$target['4'].'&amp;'.SID.'">В анкету</a><br/>'.
'<a href="?'.SID.'">В прихожую</a>['.round(($end - $mystart), 5).']</div>');
$cls->a_footer();
ob_end_flush();
@mysql_close();
?>