File size: 754B
<?php
if ($u['id']) {
$ctype = mysql_fetch_assoc(mysql_query("SELECT `id` FROM `$type` WHERE `id` = '$id'"));
if ($ctype['id']) {
if ($_POST['text']) {
if (time() > $_SESSION['antispam']) {
$text = check($_POST['text']);
mysql_query("INSERT INTO `".$type."_comm` SET `id_".$type."` = '$id', `id_user` = '$u[id]', `text` = '$text', `time` = '".time()."'");
$_SESSION['antispam'] = TIME + $config['antispam'];
redirect('?act=comm&id='.$id);
} else {
error('Антиспам. Разрешено писать раз в '.$config['antispam'].' сек.');
nav('?act=comm&id='.$id);
}
} else {
redirect('?act=comm&id='.$id);
}
} else {
redirect('?');
}
} else {
redirect('?');
}
?>