I need to create a counter for a website. Every time the visitor Number Increasing when the page load and save this counter on server. In stackoverflow, I have searched many answer with this regard.
I want to Answer the full work around, for later use, who wants to know.
2
Answers
I have searched many answer, and at last I have appended those in this procedure :
JavaScript Part :
PHP part : (phpwrite2.php)
Html Part :
CSS part :
I’d just have a very short piece of PHP code that gets called:
All your Javascript needs to do is to call the above PHP code, and the count will be returned. The
id
column is just because there needs to be some sort of row identifier – if you want to store distinct counts you could use that column to differentiate between them. No need to have the client try to check if a file exists on the server, no back-and-forth allowing multiple users to try to run the code at the same time, much less complicated.But, aren’t visit counters a bit out of fashion these days?