38018-vm/track_click.php
2026-01-30 23:37:16 +00:00

19 lines
452 B
PHP

<?php
require_once __DIR__ . '/db/config.php';
if (isset($_GET['type'])) {
$type = $_GET['type'];
try {
$db = db();
$stmt = $db->prepare("INSERT INTO click_logs (event_type) VALUES (:type)");
$stmt->execute(['type' => $type]);
} catch (Exception $e) {
error_log("Click tracking error: " . $e->getMessage());
}
}
if (isset($_GET['redirect'])) {
header("Location: " . $_GET['redirect']);
exit;
}