IP-Zero Counter
This is a script to display the number of page views/hits to your site. Very simple, and easy to follow.
AI
AIサマリー: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
ソースコード
<?
function incCount($site){
$content = file("counter.dat");
$fp = fopen("counter.dat", "w");
$i = 0;
for(; $i < count($content); $i++) {
$parts = explode(":", trim($content[$i]));
if ($parts[0] == $site) {
$num = $parts[1] + 1;
fwrite($fp, $parts[0].":".$num."\n");
}
else {
fwrite($fp, trim($content[$i])."\n");
}
}
fclose ($fp);
return $num;
}
function getCount($site){
$content = file("counter.dat");
$yes=false;
$i = 0;
for(; $i < count($content); $i++) {
$parts = explode(":", trim($content[$i]));
if ($parts[0] == $site) {
return $parts[1];
}
}
}
?>
オリジナルのコメント (3)
Wayback Machineから復元