Advertisement
ASP_Volume2 Internet/ Browsers/ HTML #43323

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

ملخص الذكاء الاصطناعي: 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.

كود المصدر
original-source
<?
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