This commit is contained in:
muzihuaner
2026-03-18 11:02:06 +08:00
parent 621164e4ef
commit 504b7c9921
37 changed files with 141 additions and 125 deletions

View File

@@ -3325,11 +3325,13 @@
?>
<?php
$counter = intval(file_get_contents("counter.dat"));
$_SESSION['#'] = true;
$counter++;
$fp = fopen("counter.dat","w");
fwrite($fp, $counter);
fclose($fp);
$file = 'counter.dat';
// 读取并自增
$counter = (int)@file_get_contents($file);
$counter++;
// 使用 LOCK_EX 防止并发写入冲突
file_put_contents($file, $counter, LOCK_EX);
?>