123456789101112131415161718192021 |
- <?php
- require 'app.php';
- if (isset($_GET['uid']) and isset($_GET['type'])) {
- $uid = $_GET['uid'];
- $type = $_GET['type'];
- if (!hasPermission("delete.$type")) {
- die("Not enough permissions.");
- }
- $sql = "DELETE FROM $type WHERE UID='$uid'";
- if ($conn->query($sql)) {
- echo "Successfully deleted $type.";
- } else {
- echo "Error deleting record: " . $conn->lastErrorMsg();
- }
- echo $conn->lastErrorMsg();
- } else {
- echo 'Something went wrong! (No type or no UID provided.)';
- }
- ?>
|