27,23 → 27,18 |
|
$error = ''; |
|
if (isset($_POST['id'])) |
{ |
if (isset($_POST['id'])) { |
$title = $_POST['title']; |
$content = $_POST['content']; |
$category = $_POST['category']; |
|
if (empty($title)) |
{ |
if (empty($title)) { |
$error = "No Title Specified"; |
} |
else if (empty($content)) |
{ |
} else if (empty($content)) { |
$error = "No Content Specified"; |
} |
else |
{ |
$page->query('UPDATE BlogPosts SET Content = "' . $content . '", Title = "' . $title . '", Category = "' . $category . '" WHERE ID = "' . $id . '"'); |
} else { |
$args = array($content, $title, $category, $id); |
$page->query("UPDATE BlogPosts SET Content = ?, Title = ?, Category = ? WHERE ID = ?", $args); |
$page->redirect('post.php?id=' . $id); |
} |
} |
52,8 → 47,7 |
$page->drawBlogCategoriesMenu(); |
$page->drawMiddle(); |
|
if (!empty($error)) |
{ |
if (!empty($error)) { |
$page->drawError($error, false); |
} |
|