HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/AppData/Roaming/Code/User/History/-510d7fa0/6pKZ.php
<?php
// monitor.php
date_default_timezone_set('Asia/Taipei');

$statsFile = 'script_stats.json';

// Get the name of the script currently running
$scriptName = basename($_SERVER['SCRIPT_NAME']);

// Load existing data
$data = file_exists($statsFile) ? json_decode(file_get_contents($statsFile), true) : [];

// Increase count for this specific script
$data[$scriptName]['hits'] = ($data[$scriptName]['hits'] ?? 0) + 1;
$data[$scriptName]['last_seen'] = date('Y-m-d H:i:s');

// Save back to the file
file_put_contents($statsFile, json_encode($data));
?>