此脚本在 100,000 后重置。我需要更改什么以防止重置并继续计数?
<?php
$filename1 = 'content/general_site_data/total_site_page_loads.txt';
if (file_exists($filename1)) {
$fh = fopen("content/general_site_data/total_site_page_loads.txt", "a+");
if($fh==false)
die("unable to create file");
$filec = 'content/general_site_data/total_site_page_loads.txt';
if (!is_writable($filec))
die('not writable');
$total_site_page_loads = trim(file_get_contents($filec)) + 1;
fwrite(fopen($filec, 'w'), $total_site_page_loads);
echo '------------------------------<br />
Site Wide Page Views: '.$total_site_page_loads.'<br />';
} else {
$fh = fopen($filename1, "a");
$total_site_page_loads = trim(file_get_contents($filename1)) + 1;
fwrite($fh, $total_site_page_loads);
fclose($fh);
echo '------------------------------<br />
Site Wide Page Views: '.$total_site_page_loads.'<br />';
}
?>