View file stat/com_add.php

File size: 1.67Kb
<?php
Defined('INDEX_S_S') or die ('Доступ запрещен!!!');
  $ms_max = 500;                       // максимальный размер поля
if ($_POST['pokas'] != 'file_com_add')
{
?>
<form name="formText" id="cform" class="ramka" action="" method="post">
<?php
if ($_SESSION['user_login'] != '')
  echo ('<div align="right">'.$_SESSION['user_login'].':</div>');
  else
  echo 'IP: '.$_SESSION['login'];

  $ms_pol = 'fa_mess1';
?>
<textarea onkeyup="Change()" onkeydown="SendComment(event)" style="width: 99%;" name="fa_mess1" rows=2 cols=20></textarea><br>
<input name="pokas" type="hidden" value="file_com_add">
<input class="knopka" type="submit" value="Добавить">
</form>
<br>
<?php }
else
{
//сoхранение
 if (trim($_POST['fa_mess1']) != '')
 {
  $mess1 = substr($_POST['fa_mess1'],0,$ms_max);
  include($cms.'flud/anti_x.php');
  $text = $mess1;

  if ($_SESSION['user_login'] != '')
  $name_quest = ('[b]'.$_SESSION['user_login'].' сказал:[/b]');
  else
  $name_quest = ('[b]Гость с IP: '.$_SESSION['login'].'[/b]');

  $mess1 = $name_quest;
  include($cms.'flud/anti_x.php');
  $name_quest = $mess1;

  $fp = fopen ($cms.'stat/'.$_GET['get_kat'].'/'.trim($pt_inf[2]).'_comment.txt', "a+");
  fwrite ($fp, date("d/m/Y").'|'.$name_quest.'|'.stripslashes($text)."\r\n");
  fclose ($fp);


  $activ = 'Комментирование файла.';
  include($cms.'moduls/act/act_add.php');
  echo '
  <META HTTP-EQUIV="Refresh" CONTENT="0;">
  ';
 }
 else
 {
  echo '
  <div class="error">
  Полле ввода пустое.</div>
  <META HTTP-EQUIV="Refresh" CONTENT="1;">
  ';
 }
}
?>
 <hr>