<?php
require 'c:/xampp/htdocs/dizzartshopping/shopnest/php-api-server/config/database.php';

$db = getDb();
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $email = $_POST['email'] ?? '';
    $token = $_POST['token'] ?? '';
    
    if ($email && $token) {
        $stmt = $db->prepare("UPDATE users SET fcm_token = ? WHERE email = ?");
        $stmt->bind_param('ss', $token, $email);
        $stmt->execute();
        echo "Token updated for $email";
    }
}
?>

<form method="POST">
    Email: <input type="text" name="email" value="t6@gmail.com"><br>
    New Token: <input type="text" name="token" style="width: 400px;"><br>
    <button type="submit">Update Token</button>
</form>
