<?php
// View the debug log
$log_file = 'debug.log';

if (file_exists($log_file)) {
    echo "<h1>Debug Log</h1>";
    echo "<pre>";
    echo htmlspecialchars(file_get_contents($log_file));
    echo "</pre>";
    echo "<p><a href='?clear=1'>Clear Log</a></p>";
    
    if (isset($_GET['clear'])) {
        file_put_contents($log_file, '');
        echo "<p>Log cleared!</p>";
    }
} else {
    echo "<p>No debug log found.</p>";
}
?>