header("Content-type: text/html; charset=windows-1251");
?>
$user="rusty_angel";
$secret="u873hkT";
if($_POST['user']!=$user || $_POST['secret']!=$secret) {
?>
} else {
$_POST['title'] = mysql_real_escape_string($_POST['title']);
$_POST['brief'] = mysql_real_escape_string($_POST['brief']);
$ts = date('U');
mysql_query("INSERT INTO publications(id_post, id_category, timestamp, title, brief) VALUES($id, {$_POST['cat']}, '{$ts}', '{$_POST['title']}', '{$_POST['brief']}')") or die(mysql_error());
echo 'OK';
}
?>