View file jpmobile/chat/post_add.php

File size: 852B
<?php

if ($_POST['sub_send'] == 'ok')
{
//сoхранение
 if ((trim($_POST['mess12']) != '') and ($_POST['mess12'] != $_SESSION['old_mess']))
 {

  $mess1 = substr($_POST['mess12'],0,500);
  include($cms.'flud/anti_x.php');
  $txt = $mess1;

  $fp = fopen ($cms.'chat/base.txt', "a+");
  fwrite ($fp, date("d/m/Y").'|'.$_SESSION['user_login'].'|'.stripslashes($txt)."\r\n");
  fclose ($fp);
  $_SESSION['old_mess'] = $_POST['mess12'];
 }
 else
 {
  echo '
  <span class="error">
  Полле ввода пустое.</span>
  ';
 }
}
?>

<div class="ramka">
<form name="" action="" method="post">
<textarea style="width: 95%;" name="mess12" rows=3 cols=20></textarea><br>
<input name="sub_send" type="hidden" value="ok">
<input class="knopka" type="submit" value="&nbsp;Сохранить&nbsp;">
</form>
</div>