How to update a content of webpage in real time?

I want to create a view counter for my blogs page. Which means that, whenever someone hits the page, it updates the visitors counts of at all the users using that page without refreshing or reloading the page. How can I achieve? I am building my web app using HTML, CSS, Javascript and PHP and DBMS I am using is MySQL.

2/3/2020 3:51:54 PM

Shashank Shekhar

2 Answers

New Answer


You need Ajax and jQuery. Check this link if it helps: https://stackoverflow.com/questions/22577457/update-data-on-a-page-without-refreshing The whole idea is on "whenever someone hits the page" a query to your DBMS outputs the updated result of visitors like "count(SELECT * from visitors)" To do all this without refreshing Ajax with jquery is the solution.


That's what AJAX is meant for but you'll be syncing view counts inside the database