<?php
session_start();
include_once __DIR__ . '/index.php';  // Laad centrale config

// Reset de sessie-visit count
$_SESSION['visit_count'] = 0;

// Wis het logbestand
$logFile = $config['log_file'];
if (file_exists($logFile)) {
    if (file_put_contents($logFile, '') === false) {
        echo "Error: Could not delete logs. Check file permissions: " . $logFile;
    } else {
        echo "logs deleted, you can close this page";
    }
} else {
    // Probeer aanmaken als het niet bestaat
    if (file_put_contents($logFile, '') === false) {
        echo "Error: Could not create log file. Check folder permissions.";
    } else {
        echo "Log file created and logs deleted, you can close this page";
    }
}
?>
