THdie("Another static page already has name '" . $name . "'."); } // I guess this is OK. Add it. $pageid = $db->addstaticpage($name, $title); // Redirect! header("Location: " . THurl . "admin.php?a=spe&id=" . $pageid); } elseif ($_GET['t'] == "spx") { // verify parameters if (!isset($_GET['id'])) { THdie("ID parameter not specified!"); } $id = intval($_GET['id']); // Clear the cache smclearpagecache($id); // Delete it from the DB $db->delstaticpage($id); // Redirect to the static pages list header("Location: " . THurl . "admin.php?a=sp"); } elseif ($_GET['t'] == "spe") { // Verify parameters if (!isset($_POST['id'])) { THdie("ID parameter not specified!"); } if (!isset($_POST['name']) || !isset($_POST['title'])) { THdie("Name and/or title parameter not specified!"); } if (!isset($_POST['publish']) || !isset($_POST['content'])) { THdie("Publish and/or content parameter not specified!"); } // Don't bother checking if the id actually // refers to something that exists - the way our SQL