File size: 1.39Kb
<?php
Defined('INDEX_S_S') or die ('Доступ запрещен!!!');
if ($_POST['pokas'] != 1)
{ ?>
<span class="ramka">
<form name="" action="" method="post">
<?php
if ($_SESSION['user_login'] != '')
echo ('<div align="right">'.$_SESSION['user_login'].':</div>');
else
echo 'IP: '.$_SESSION['login'];
?>
<textarea style="width: 100%;" name="gb_mess1" rows=3 cols=20></textarea><br><br>
<input name="pokas" type="hidden" value="1">
<input class="knopka" type="submit" value=" Сохранить ">
</form>
</span>
<br>
<?php }
else
{
//сoхранение
if (trim($_POST['gb_mess1']) != '')
{
$mess1 = substr($_POST['gb_mess1'],0,500);
include('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('flud/anti_x.php');
$name_quest = $mess1;
$fp = fopen ('gb/gb_base.txt', "a+");
fwrite ($fp, date("d/m/Y").'|'.$name_quest.'|'.stripslashes($text)."\r\n");
fclose ($fp);
$activ = 'Активность в гостевой.';
include('moduls/act/act_add.php');
echo '
<span class="ramka">
Сохранено.</span>
<META HTTP-EQUIV="Refresh" CONTENT="1;">
';
}
else
{
echo '
<span class="error">
Полле ввода пустое.</span>
<META HTTP-EQUIV="Refresh" CONTENT="1;">
';
}
}
?>
<hr>