更新
This commit is contained in:
@@ -1 +0,0 @@
|
||||
4
|
||||
@@ -1,10 +1,12 @@
|
||||
<?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);
|
||||
|
||||
header('Access-Control-Allow-Origin:*');
|
||||
$str = file_get_contents('http://cn.bing.com/HPImageArchive.aspx?idx=0&n=1');
|
||||
|
||||
Reference in New Issue
Block a user