Размер файла: 2.08Kb
- <?php
- /*
- =============================================
- Движок: SHCMS Engine
- =============================================
- Название файла: Библиотека
- =============================================
- Official website: http://shcms.ru
- =============================================
- Данный код защищен авторскими правами
- =============================================
- */
- define('SHCMS', true);
- include_once'../system/inc/basic_settings.php';
- $shcmsengine['title'] = 'Создании нового раздела';
- include_once'../template/head.php';
-
- if($_POST['submit'])
- {
- $submit = $_POST['submit'];
- }
-
- if(isset($submit))
- {
- if($_POST['name'])
- {
- $name = $_POST['name'];
- }
-
- if($_POST['text'])
- {
- $text = $_POST['text'];
- }
-
- if(empty($name))
- {
- echo '<div class="errors">Введите название раздела</div>';
- header("Refresh: 1; url=new_razd.php");
- include_once'../template/foot.php';
- exit;
- }
-
- $ok_lib = mysql_query("INSERT INTO `libs` (`name`,`time`,`text`) VALUES ('$name','".time()."','$text')");
- if($ok_lib == true)
- {
- echo '<div class="actshcms">Раздел успешно создан</div>';
- header("Refresh: 1; url=/libs/");
- include_once'../template/foot.php';
- exit;
- }
- else
- {
- echo '<div class="actshcms">Ошибка при создании раздела</div>';
- header("Refresh: 1; url=new_razd.php");
- include_once'../template/foot.php';
- exit;
- }
- }
-
-
- echo '<form action="?" method="post">';
- echo 'Название раздела:<br/><input type="text" name="name"><br/>';
- echo 'Описание раздела:<br/><textarea id="text" name="text"></textarea><br/>';
- echo '<input type="submit" name="submit" value="Создать">';
- echo '</form>';
-
- include_once'../template/foot.php';
- ?>