17 lines
368 B
PHP
17 lines
368 B
PHP
<?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'];
|
|
|
|
$pdo->prepare("DELETE FROM contadores WHERE uid=?")->execute([$uid]);
|
|
|
|
echo json_encode(["ok"=>1]);
|