File size: 623B
<?php
include '../wap/config.php';
$tag=htmlspecialchars(trim($_POST['tag']),ENT_QUOTES);
$txt=htmlspecialchars(trim($_POST['txt']),ENT_QUOTES);
if (($tag=='')||($txt=='')) {
print "<html><head><title>пЫЙВЛБ</title></head><body>оЕ ЧУЕ ДБООЩЕ ЧЧЕДЕОЩ</body></html>";
exit;
}
if (!($conn=pg_connect("host=$dbhost port=$dbport dbname=$dbname user=$dbuser password=$dbpass"))) {
echo ("пЫЙВЛБ РПДЛМАЮЕОЙС Л вд!\n");
exit;
};
$res=pg_query($conn,"SET CLIENT_ENCODING TO 'KOI8';");
$res=pg_query($conn,"insert into chat_tags (tag,txt) values ('$tag','$txt');");
header("Location: tags.php");
pg_close($conn);
?>