I am having a problem in counting the user that visit to a website of mind using php.
I want to count those user by day, week, month, in total and store them in MYSQL database.
I have been searching through lots of site and still cannot figure it out yet.

Please someone help me with this.

Recommended Answers

All 2 Replies

If you have login in your site this is very simple, just create database table containing users who login and you can count it using sql count function when querying.
If you don't have try to use Google analytics, its free and you can track your visitors, views and statistics.

For all type of user(registered and unregistered) you can use session_id() and it works like this if the session_id() is set then increment a counter otherwise no action.....
Check this link to understand more about session_id()....Click here..
Also if u just want to do for registered users then add a field in database and assign a particular value ..if user logins change that field value and for every change make track of records.....
Hope this is clear....
PS-If your problem is solved mark this thread as solved so that it would be easy to navigate through other's thread and be notified that your problem is solved....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.