meowboard/delete.php

19 lines
454 B
PHP
Raw Permalink Normal View History

2024-10-22 13:40:57 +01:00
<?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=/\">");
}
?>