Previously seen in Osso many such examples, the various methods are complex, please see the following examples to implement graphics counters. Use in Web pages please use <script src= "http://file address" ></script>
?
A text file that holds the count
$count = "Count.txt";
Number of digits of the counter, if not filled, the default is 6-bit
$wei = "";
The URL path of the image
$tu = "/tcount/images";
?>
?
if ($wei = = "") {$wei = 6;}
if (!file_exists ($count)) {$fp =fopen ($count, "w"); Fputs ($fp, 0,100); Fclose ($FP); }
if ($REMOTE _addr!= $ip) {
$FP =fopen ($count, "R");
$CC =fgets ($fp, 100);
$CC =trim ($CC);
if ($cc = = "") {$cou = 1;}
else {$cou = $cc 1;}
Rewind ($FP);
Fputs ($fp, $cou, 100);
Fclose ($FP);
}
Setcookie ("IP", $REMOTE _addr,time () 86400);
$FP =fopen ($count, "R");
$cou =fgets ($fp, 100);
$cou =trim ($cou);
Fclose ($FP);
$w =strlen ($cou);
while ($w < $wei) {
$cou = "0". $cou;
$w;
}
$www =strlen ($cou);
$i = 0;
echo "document.write (" <p align=center> "); n";
while ($i < $www) {
$ym =substr ($cou, $i, 1);
echo "document.write (" "); n";
$i;
}
?>