Copyright © 1992-2022 only by n-m-w.com - All rights reserved - Counter: * $c=strip_tags($_GET['c']); $digits = ""; $paddingchar = "0"; $thousandsdelimiter = "."; $filelocation = "counter.dat"; if (!file_exists($filelocation)) { $newfile = fopen($filelocation,"w+"); $content=1; fwrite($newfile, $content); fclose($newfile); } $newfile = fopen($filelocation,"r"); $content = fread($newfile, filesize($filelocation)); fclose($newfile); $newfile = fopen($filelocation,"w+"); if ($c==''){$content++;} fwrite($newfile, $content); fclose($newfile); if ($digits!=""){ $out=""; if (strlen($content) < $digits){ for ($i=0;$i<$digits-strlen($content);$i++){ $out.=$paddingchar; } $content=$out.$content; } } else{ $out=number_format($content); $content=str_replace(",",$thousandsdelimiter,$out); } echo $content; function load($filelocation){ if (file_exists($filelocation)){ $newfile = fopen($filelocation,"r"); $file_content = fread($newfile, filesize($filelocation)); fclose($newfile); return $file_content; } } ?> User * |