#native_company# #native_desc#
#native_cta#

Counter

By Gary Jones
on March 21, 2004

Version: 0.3

Type: Full Script

Category: Other

License: GNU General Public License

Description: Yes theres alot, but this ones object oriented!

class counter {
	var $file = 'hits.txt'; // Rename this path/to/file to your choosing - it will store the data.
				// Best to create file first, with 777 permissions.
	function counter()
	{
		$this->readFile();
		$this->writeFile();
	}
	
	function readFile()
	{
		$hiti = fopen($this->file, "r");
		while(!feof($hiti)){
			$this->$hits .= fgets($hiti,128);
		}
		$this->$hits=1+$this->$hits;
		echo $this->$hits;
		fclose($hiti);
	}
	
	function writeFile()
	{
		$hito = fopen($this->file,"w+");
		fputs($hito,$this->$hits);
		fclose($hito);
	}
	
}
// Usage
// $count = new counter;