iGuest 3 Report post Posted May 2, 2005 this is a counter with images and stor in flat filebecouse i can not upload .zip .rar file iwell program it on this post at frist you need to 2 files count.phpcount.txtand you need else make folder has name gifs and make 10 pictuer 10 file 0.gif to 9.gifnow all ok open the count.php and add this code <? ### IMAGE FORMAT $format = ".gif"; $file = file("count.txt"); $num = ($file[0] + 1); exec("echo $num > count.txt"); switch($type) { case "text": echo $num; break; case "gfx": $i = 0; $cntn = strlen($num); while($i < $cntn) { $tmpnum = substr($num, $i, 1); echo("<img src=\"$dir/$tmpnum$format\">"); $i++; } break; case "q": break; default: echo("count.php <b>error</b> : type not specified."); break; } ?>thats all Share this post Link to post Share on other sites
FirefoxRocks 0 Report post Posted September 22, 2008 If this is a script that is supposed to produce a hit counter that loads images for its numbers, it is poorly designed. The concept that is.With the fonts, colours and various CSS properties available and usable in todays browsers, why do we need to make a counter with images?As for the functionality of your PHP script, I haven't tested it out yet but I would think that if I were to write a counter, I would store the data within the PHP file itself. Share this post Link to post Share on other sites
magiccode91405241511 0 Report post Posted September 23, 2008 It is best not to use system function when typical php functionsdo the job. Create a function to wrap the steps for opening and closing file, and / or also the compute steps.Should this use division and remainder be much better ?It is just my opinion Share this post Link to post Share on other sites