:1: First things first, open a blank page and save it as hits.txt. This file will record our visitors.

:2: Now create a new file, save it as counter.php and paste the following code:


Don’t worry about what all of this means. Basically, the code above records the number of unique visits (based on IP) to your hits.txt file. :!?:

:3: Now upload both files to the same directory and ChMOD your hits.txt to 777.

:4: To display the counter, you need to include counter.php wherever you’d like the number to be displayed:


You’d probably want it to display as something like “XXX visitors since XX/XX/05”:

 visitors since XX/XX/05

:5: Whichever file you decide to add this piece of code to must be saved as a .php file. Otherwise it won’t recognize this snippet of PHP code.

credits: createblog

Leave a comment