File size: 1.13Kb
<?php
include_once "../config.php";
include_once "../inc/inc.php";
include_once "../inc/func.php";
include_once "../inc/user.php";
include_once "../inc/gzip.php";
include_once "../inc/online.php";
if ($dostup != '1') {
echo "ПАШШШШШШШОЛНАХУЙ";
include_once "../themes/$theme/foot.php";
exit;
} else {
$naz = htmlspecialchars(stripslashes($naz));
$opis = htmlspecialchars(stripslashes($opis));
$pravila = htmlspecialchars(stripslashes($pravila));
$query = "SELECT * FROM " . $pref . "forum ORDER BY nomer";
$result = mysql_query($query);
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$max = $line['nomer'];
}
$max=(int)$max;
if ($max==0){$max=$max+1;
$zapros2='TRUNCATE TABLE `'.$pref.'forum`';
mysql_query($zapros2);
}else{$max++;}
//$max++;
//echo $max;
$max=(int)$max;
$zapros20 = 'INSERT INTO ' . $pref . 'forum (nomer, name, opis, pravila) VALUES (' . $max . ', "' . $naz . '", "' . $opis . '", "' . $pravila . '");';
mysql_query($zapros20) or die('ERROR');
header("Location: forum.php");
}
?>