This commit is contained in:
teasiu
2023-12-24 22:17:16 +08:00
parent 005e9e30d4
commit 1f79c5b439
4 changed files with 87 additions and 55 deletions

18
static/ad_visit.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
// 在这里记录访问次数或者其他必要的处理
// 模拟访问次数的记录,可以存储到数据库中或文件中
$file = 'ad_count.txt'; // 存储访问次数的文件
$visitCount = 0; // 初始访问次数
if (file_exists($file)) {
$visitCount = (int)file_get_contents($file); // 从文件中获取访问次数
}
$visitCount++; // 每次访问增加1次访问次数
file_put_contents($file, $visitCount); // 将访问次数写入文件
// 返回访问次数以便前端 JavaScript 进行显示
echo $visitCount;
?>