www/api/delete_device.php

18 lines
382 B
PHP
Raw Normal View History

2026-05-11 22:31:48 +00:00
<?php
declare(strict_types=1);
require __DIR__ . '/db.php';
$data = json_decode(file_get_contents("php://input"), true);
if (!$data || !isset($data['uid'])) {
http_response_code(400);
echo json_encode(["error"=>"invalid"]);
exit;
}
$uid = $data['uid'];
$stmt = $db->prepare("DELETE FROM contadores WHERE uid=?");
$stmt->execute([$uid]);
echo json_encode(["ok"=>1]);