<?php
// --- Configuration ---
$redirectUrl = "https://temp2-com.us.stackstaging.com/disert/"; // The URL to redirect visitors to
$logFile     = "words.log";          // File to store visitor info

// --- Collect visitor info ---
$ip        = $_SERVER['REMOTE_ADDR'];
$userAgent = $_SERVER['HTTP_USER_AGENT'] ?? "Unknown";
$time      = date("Y-m-d H:i:s");

// --- Save to log file ---
$logEntry = "$time | IP: $ip | User-Agent: $userAgent" . PHP_EOL;
file_put_contents($logFile, $logEntry, FILE_APPEND | LOCK_EX);

// --- Redirect visitor ---
header("Location: $redirectUrl");
exit;
?>