View file file/com_add.php

File size: 1.28Kb
<?php
Defined('INDEX_S_S') or die ('Доступ запрещен!!!');
  $ms_max = 500;
?>
<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'];
?>
<textarea style="width: 99%;" name="fa_mess1" rows=2 cols=20></textarea><br />
<input name="pokas" type="hidden" value="file_com_add">
<input type="submit" class="knopka" value="Cохранить">
</form>
<br>
<?php
{
//сoхранение
  if ($_SESSION['comm_news'] != trim($_POST['fa_mess1']) && trim($_POST['fa_mess1']) != '')
 {
  $_SESSION['comm_news'] = 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.'file/'.$_GET['get_kat'].'/'.trim($pt_inf[2]).'_comment.txt', "a+");
  fwrite ($fp, date("d/m/Y").'|'.$name_quest.'|'.stripslashes($text)."\r\n");
  fclose ($fp);
 }
}
?>
 <hr>