PX : code

phpCounter by Nicola Delbono
Download this code


<!-- 
/*     This counter has been created by Nicola Delbono <key5@key5.com>            */
/*    you can modify and/or use the code for free. Pleeease keep these three lines        */
/*    into your customized counter                                    */
  -->
<?
$visits = file($memo_file); /* file passed from the page of the site    */
$number_of_last_visit = $visits[0];
$number_of_new_visit = ++$number_of_last_visit;
$fp = fopen($memo_file, "w");
$fw = fwrite($fp, $number_of_new_visit);
fclose($fp);

/* if you don't need graphical numbers(images) you can cut the following     */
/* code and simply add a line like this:  echo $number_of_new_visit;    */

$len_str = strlen($number_of_new_visit);
/* reads every single number that forms the number of visits. If visits=1000 =>1 0 0 0    */
for($i=(0);$i<$len_str;$i++){
$numbers_exploded = substr($number_of_new_visit,$i,1);
$output_str = $output_str . "<img src=\"$numbers_exploded.gif\">";

}

echo  $output_str;
?>

<?
/*In the page you want to output the counter (not this one), you have to add this little code */
/*<? $memo_file="any_txt_file.txt"; require ("count.php3");?>*/
?>


Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.