robsd / php-hit-counter

A simple PHP and JavaScript AJAX hit counter that counts and displays the number of hits for each page on your website.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

php-hit-counter 🎯

A simple PHP and JavaScript AJAX hit counter that counts and displays the number of hits for each page on your website.

Installing on your own site

  1. Create a <span id="hit-count"></span> element on every page where you want to display the hit count number for that page.
  2. Copy the <script src="hit-counter/js/script.js"></script> declaration on every page you created the above element on.
  3. Copy the hit-counter folder to your web server.
  4. Thats it! If everything works, you should start seeing the hit count being displayed on each page you added it to and the hit-counter/hits.json file being populated.

Need a hint?

See the example.html file for how to create the element and declare the JavaScript.

Support my work

If you like this repo or used any of the code, please star ⭐ it and consider supporting me below...

ko-fi

About

A simple PHP and JavaScript AJAX hit counter that counts and displays the number of hits for each page on your website.

License:MIT License


Languages

Language:HTML 58.1%Language:PHP 22.3%Language:JavaScript 19.7%