meowboard/delete.php

18 lines
454 B
PHP

<?php
include 'include/db.php';
include 'include/templates.php';
if (!isset($_GET['id'])) {
die("<meta http-equiv=\"refresh\" content=\"0; url=/\">");
}
if (isAdmin(tokenToUuid($_COOKIE["meowboardSession"])) == 1) {
global $db;
$statement = $db->prepare("DELETE FROM images WHERE id = ?");
$statement->bindParam(1, $_GET['id'], SQLITE3_INTEGER);
$result = $statement->execute();
die("<meta http-equiv=\"refresh\" content=\"0; url=/\">");
}
?>