Version: 2.2b

Type: Sample Code (HOWTO)

Category: Databases

License: GNU General Public License

Description: This is a basic logging counter program I have been using. I appreciate any and all comment on my code as I am relatively new to php and imagine there is always a better way to do something. Thanks for any tips.



<? /* Counter Code . Created by Joost van Wollingen 2002 */
      	@include("counter.php");
      	$visitor=$visitor+1;

        /* Edit to match your html code */

      	echo "<BR><BR><font size=2><center>You are visitor :<BR>$visitor";

        /* Don't edit this */            
       	$file = fopen("counter.php","w+");
	$data = "<?php \$visitor = \"" . $visitor . "\";";
	$data .= "?>";
	fputs($file, $data);
	fclose($file);
      ?>