<?php
// Optional: Set default timezone (adjust according to your needs)
date_default_timezone_set('Europe/Amsterdam');

// Get the current date and time in the desired format
$datestamp = date('Y-m-d H:i:s');

// Get the domain name from the HTTP Host header
$domain = $_SERVER['HTTP_HOST'];

// Build the log entry with the datestamp at the beginning
$logEntry = $datestamp . " visitor visiting " . $domain . "\n";

// Append the log entry to the file
file_put_contents("/home/nas_veffer/greyt.txt", $logEntry, FILE_APPEND);

// Redirect to the intended URL
header("Location: https://www.greyt.eu");
exit;
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="refresh" content="0; url=https://www.greyt.eu">
    <title>Redirecting...</title>
</head>
<body>
    <p>If you are not redirected automatically, follow this <a href="https://www.greyt.eu">link to Greyt</a>.</p>
</body>
</html>
