if ($res) { Header("Location: " . $_SERVER['PHP_SELF']); } } function deleteImage($id) { global $dbi; sql_query("DELETE FROM jones_binarydata WHERE id='{$id}'", $dbi); Header("Location: " . $_SERVER['PHP_SELF']); } set_error_handler("myErrorHandler"); if (isset($_GET['cmd'])) { $cmd = $_GET['cmd']; } else { if (isset($_POST['cmd'])) { $cmd = $_POST['cmd']; } else { $cmd = ""; } } switch ($cmd) { case "finishUpload": finishUpload($_FILES['image_file']['tmp_name'], $_FILES['image_file']['type'], $_FILES['image_file']['size'], $_FILES['image_file']['name']); break; case "deleteImage": deleteImage($_GET['id']); break; default: main(isset($_GET['error']) ? $_GET['error'] : ""); break; }
case "deleteCategory": deleteCategory($_GET['id']); break; case "edit": editBlogEntry($_GET['id']); break; case "finishEdit": finishEditBlogEntry($_POST['id'], $_POST['editBlogCategory'], $_POST['editBlogTitle'], $_POST['editBlogText'], $_POST['editBlogExtText']); break; case "delete": deleteBlogEntry($_GET['id']); break; case "upload": upload($_GET['id'], isset($_GET['error']) ? $_GET['error'] : ""); break; case "finishUpload": finishUpload($_POST['blog_id'], $_POST['description'], $_FILES['image_file']['tmp_name'], $_FILES['image_file']['type'], $_FILES['image_file']['size'], $_FILES['image_file']['name']); break; case "editImage": editImage($_GET['id']); break; case "finishEditImage": finishEditImage($_POST['id'], $_POST['description'], $_POST['blog_id']); break; case "deleteImage": deleteImage($_GET['id'], $_GET['blog_id']); break; default: main(isset($_GET['PHP_SELF']) ? $_GET['PHP_SELF'] : ""); break; }