Файл: host/public_html/forum/new_razdel.php
Строк: 30
<?
include_once '../core/system.php';
echo admin();
$header = 'Форум';
include_once '../core/head.php';
switch($act) {
case 'post':
if(isset($_POST['name'])) {
$name = check($_POST['name']);
if(strlen($name) < 3 or strlen($name) > 40) $err = '<h2>Длина названия должна быть в пределах 3 - 40 символов';
if(!isset($err)) {
mysql_query("INSERT INTO `forum_razdel` SET `name` = '$name'");
header('Location: /forum/');
$_SESSION['message'] = '<h2>Раздел создан!';
exit();
}else{
header('Location: /forum/');
$_SESSION['err'] = $err;
exit();
}
}
break;
default;
echo '<form class="block" method="post" action="?act=post"><h2>
Введите Название</h2><br /><input class="text large" type="text" name="name" /><br />
<span class="btn"><span class="end"><input class="label" type="submit" value="Создать"></span></span>
</form>';
}
include_once '../core/foot.php';
?>