<?php
require_once "config.php";

if($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['id'])) {
    $id = intval($_POST['id']);
    $res = $conn->query("DELETE FROM adverts WHERE id=$id");
    echo $res ? 'success' : 'error';
}
