更新
This commit is contained in:
@@ -1,11 +1,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);
|
||||
|
||||
require ('../../need.php');//引用封装好的函数文件
|
||||
$n = @$_REQUEST["n"];
|
||||
|
||||
Reference in New Issue
Block a user