Просмотр файла forum/add_r.php

Размер файла: 2.31Kb
<?

include_once "../SYSTEM/include/functions.php";

include_once "../SYSTEM/include/mysql.php";

include_once "../SYSTEM/include/param.php";

include_once "../SYSTEM/include/ban.php";

include_once "../SYSTEM/include/sess.php";

include_once "../SYSTEM/include/ban_2.php";

include_once "../SYSTEM/include/theme.php";

$title='Создать раздел';

$mesto='Создает раздел в форуме';

head();

if (!isset($_GET['id_forum']))

{

header ("Location: index.php?".SID."&");


exit;

}

$id_forum=intval($_GET['id_forum']);

$q = mysql_query("SELECT * FROM `$mysql[pref]forum_f` WHERE `id` = '$id_forum';");

if(mysql_num_rows($q) != 0)

{

$forum = mysql_fetch_array($q);

}

else

{

header ("Location: index.php?".SID."&");


exit;

}


if (!isset($user) || $user['level']<2)

{

header("Location: index.php?".SID."&");

exit;

}

if (isset($_GET['act']) && $_GET['act']=='add' && isset($_POST['name']) && isset($_POST['num']))

{

$name=$_POST['name'];

$num=intval($_POST['num']);

if (isset($_POST['tr']))

{

$name=translit($name);

}

$name=stripslashes(htmlspecialchars($name));


$name_t=$name;

mysql_query("INSERT INTO `$mysql[pref]forum_r` (name, num, time, id_f)

values('$name_t', '$num', '$time', $id_forum)");

action("Создание раздела в форуме");

header("Location: index.php?".SID."&msg=add_r&id_forum=$id_forum");

exit;

}






echo "<div class=\"h\"><b>Добавить раздел</b></div><hr />\n";


if ($mail_in_new>0)echo "<div class=\"privat\"><img src=\"../SYSTEM/themes/$them/img/mail0.gif\" alt=\"\" /> <a href=\"../mail.php?act=in\">Приват</a> [$mail_in_new]</div><hr />\n";


echo "<form method=\"post\" action=\"add_r.php?id_forum=$id_forum&amp;act=add\">\n";

echo "Название:<br />\n<input name=\"name\" class=\"form\" type=\"text\" /><br />\n";

echo "Позиция:<br />\n<input name=\"num\" class=\"form\" type=\"text\" value=\"1\" /><br />\n";

echo "<input type=\"checkbox\" name=\"tr\" value=\"1\" /> Транслит<br />\n";

echo "<input value=\"Добавить\" class=\"form\" type=\"submit\" />\n";

echo "</form>\n";

echo "<br />\n";






echo "<a href=\"index.php\">Вернуться</a>\n";

echo "<br /><a href=\"../index.php\">На главную</a>\n";


foot();

?>