How to Make a PHP Hit Counter
A hit counter or a page counter counts the number of people that visit your page. If you have created a new website, you might be interested in how many people are visiting.
Steps
We could really use your help!
computers?

estate planning?

business operations?

small business?

Tips
- This code explained: In this code you made a session called "views", this is where your session data is stored. When someone opens their web browser or refreshes it, the page number will be increased by one, this will be useful if you want to see if someone is re-visiting the website. Then you use the "echo" function to print it all onto the page.
Things You'll Need
- A bit of programing knowledge if you don't know any PHP or HTML - this is not necessary, but it will help you to understand this tutorial better.
Article Info
Categories: Creating and Enhancing a Website | PHP
Recent edits by: Adelaide, Abhi, Chris
In other languages:
Español: Cómo hacer un contador de visitas PHP, Italiano: Come Creare un Contatore di Visualizzazioni in PHP, Português: Como Criar um Contador de Visitas em PHP, Русский: написать счетчик посещений сайта на РНР
Thanks to all authors for creating a page that has been read 58,609 times.