-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcounter_reset.php
More file actions
22 lines (19 loc) · 794 Bytes
/
Copy pathcounter_reset.php
File metadata and controls
22 lines (19 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
/**
* ONE-TIME USE — delete this file from the server after running it.
* Resets the visitor counter so the next person to visit becomes #1.
* Access: squimballstudios.com/counter_reset.php?token=squimball_reset
*/
$SECRET = 'squimball_reset';
if (($_GET['token'] ?? '') !== $SECRET) {
http_response_code(403);
echo 'Forbidden';
exit;
}
$dataFile = __DIR__ . '/data/vc.json';
if (file_exists($dataFile)) {
unlink($dataFile);
echo 'Counter reset. data/vc.json deleted.<br>Visit the main site now to claim visitor #1.<br><strong>Delete this file from your server.</strong>';
} else {
echo 'data/vc.json does not exist — counter is already at zero.<br>Visit the main site now to claim visitor #1.<br><strong>Delete this file from your server.</strong>';
}