Live · PHP + MySQL
Visitor counter
A loving nod to the 90s web counter — except this one is real. Every page view bumps a server-side odometer (counted once per browser session, no tracking, no cookies beyond a plain PHP session, no IP or user-agent stored). Below: who dropped by recently and where everyone’s going.
- session-scoped, one hit per visit
- no IP · no user-agent stored
- JSON over api/hits.php
- capped visit log
Loading the odometer…
api/hits.php, which increments a site_hits row
and appends to a capped site_visits log in MySQL, then returns
the totals as JSON. Visitors get a throwaway handle like
CosmicOtter for the session — friendly, not identifying. Drop
<span id="hitcounter"></span> plus
counter.css / counter.js into any page for the
compact version.