<?php
require 'db.php';

if (isset($_GET['token'])) {
    $token = $_GET['token'];
    $sql = "UPDATE users SET verified = 1 WHERE token = ?";
    $stmt = $conn->prepare($sql);
    $stmt->bind_param("s", $token);
    $stmt->execute();

    echo "Email verified! You can now <a href='login.php'>login</a>.";
}
?>