Размер файла: 2.25Kb
- <?
- /*
- =============================================
- Движок: SHCMS Engine
- =============================================
- Название файла: Форум
- =============================================
- Official website: http://shcms.ru
- =============================================
- */
- define('SHCMS', true);
- include_once'../system/inc/basic_settings.php';
- $shcmsengine['title'] = 'Создать новый раздел';
- include_once'../template/head.php';
- registrat();
- if($user4['team'] == 6)
- {
-
-
-
- if($_POST['submit'])
- {$submit = $_POST['submit'];}
-
-
- if(isset($submit))
- {
- if($_POST['name'])
- {$name = $_POST['name'];}
- if($_POST['message'])
- {$message = $_POST['message'];}
-
-
- if(empty($name))
- {
- echo'<div class="errors">Введите название</div>';
- include_once'../template/foot.php';
- exit();
- }
- if(empty($message))
- {
- echo'<div class="errors">Введите описание</div>';
- include_once'../template/foot.php';
- exit();
- }
- if(strlen($name)< 0 || strlen($name) >30)
- {
- echo'<div class="errors">название должен быть не больше 30 символов</div>';
- exit();
- }if(strlen($message)< 0 || strlen($message) >255)
- {
- echo'<div class="errors">Описание должен быть не больше 255 символов</div>';
- exit();
- }
- $name = trim($name);
- $name = stripslashes($name);
- $name = htmlspecialchars($name);
-
-
-
- if(isset($name) && isset($message))
- {
- $mysql_ok = mysql_query("INSERT INTO forum_cat (name,message,time) VALUES ('$name','$message','$time_date')");
- if($mysql_ok == true)
- {
- echo'<div class="actshcms">Раздел успешно создан</div>';
- echo'<div class="uncom"><a href="razd_new.php">Назад</a></div>';
- exit();
- }
- else
- {
- echo'<div class="errors">Ошибка создании нового раздела</div>';echo'<div class="uncom"><a href="razd_new.php">Назад</a></div>';exit();
- }}
-
-
- }
- echo '<form action="?'.$conservation.'" method="post">"';
- echo 'Название:<br/><input type="text" name="name"><br/>';
- echo 'Описание:<br/><input type="text" name="message"><br/>';
- echo '<input type="submit" name="submit"></form>';
-
- }
- else
- {
- header('Refresh: 1; url=./');
- }
- include_once'../template/foot.php';
- ?>