Subversion Repositories taios

Rev

Rev 267 | Rev 269 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
266 tom 1
<?php
2
 
3
require '../_taios.php';
4
 
5
$page = new Taios_Page('Add Category', '../');
6
 
7
$page->checkLoggedIn();
8
 
9
$parentID = $_GET['parentID'];
10
if (empty($parentID))
11
{
12
    $parentID = -1;
13
}
14
 
15
$title = $_POST['title'];
16
$description = $_POST['description'];
17
 
18
if ($page->isUserAdmin($page->getLoggedInUser()))
19
{
20
    if (empty($title))
21
    {
22
        $page->redirect('add-category.php?error=No Title Specified');
23
    }
24
 
267 tom 25
    $page->query('INSERT INTO ForumCategories VALUES (0, ' . $parentID . ', "' . $title . '", "' . $description . '")');
266 tom 26
    $page->redirect('index.php?parentID=' . $parentID);
27
}
28
else
29
{
30
    $page->drawError('You do not have permission to access this page.');
31
}
32
 
33
?>
34