Location: PHPKode > scripts > phpHitCounter > phphitcounter/examples/sample2.php

/* sample two : simple text based hitcounter but looks for unique visitors */

/* include the main class file */

// create a object of the class hc,
// store the hits in a file,
// if the file does not exists try creating the file
// log visitors in a file
$hit=new hc("c:/hits.txt",true,"c:/visitor.txt");

// tell the counter to report only unique visitors

// register a site hit

// display the hit counter
echo "You are visitor number: ";
echo $hit->showCounter();
Return current item: phpHitCounter