Very simple hits counter

Started on the old forum in January 2010 · view the original in the archive · old links redirect here

4 replies · 1,004 views · started 16 years ago · 1 min read

4 participants
GumSlone Administrator Principal · 1,690 posts #1

create counter.txt file and chmod 777 it.

and add this php code to your page

<?php
$file = 'counter.txt';
$counter =  intval(file_get_contents($file));
$counter++;
file_put_contents($file,$counter);
echo number_format($counter, 0, ',', ' ').' hits.';
?>

thats all 🙂 isn't it simple?

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close