$dirname1 = '../counters';
$dirN = '../uploads';
$extens = ".txt";
$fh = fopen(".$dirname1/$filename.$extens", "w");
if(fopen(".$dirN/$filename.", "r")) {
$count_my_page = (".$dirname1/$filename.$extens");
$hits = file($count_my_page);
$hits[0] ++;
$fp = fopen($count_my_page , "w");
fputs($fp , "$hits[0]");
fclose($fp);
echo $hits[0];
}
,計數應該更新....但它只會發生在第一次.....增加了對數讀
$ count_my_page是一個文件名,它的if語句中的第一道防線。 – SilentGhost 2009-06-15 13:19:38