Counter
1) Text counter
$countfile = "/count.txt"; Set up files to save data
if (!file_exists ($countfile)) {//Determine if the file exists
EXEC ("Echo 0 > $countfile");
}
$fp = fopen ($countfile, "RW");
$length =filesize ($countfile);
$num = Fgets ($fp, $length);
$num + = 1;
EXEC ("Rm-rf $countfile");
EXEC ("echo $num > $countfile");
Print "Traffic totals:". " $num "." "; Show access times
?>
2) Graphics counter
$countfile = "/count-num.txt"; Set up files to save data
if (!file_exists ($countfile))//Determine if the file exists
{EXEC ("echo 0 > $countfile");}
$fp = fopen ($countfile, "RW");
$length =filesize ($countfile);
$num = Fgets ($fp, $length);
$num + = 1;
EXEC ("Rm-rf $countfile");
EXEC ("echo $num > $countfile");
$len _str = strlen ($num);
for ($i =0; $i < $len _str; $i + +) {
$each _num = substr ($num, $i, 1);
$out _str = $out _str. "";
}
Print "Traffic totals:". " $out _str "." "; Show access times
?>