954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Visitor Count

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.

channsoung
Newbie Poster
1 post since Apr 2011
Reputation Points: 10
Solved Threads: 0
 

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.

codewall
Junior Poster in Training
80 posts since Dec 2010
Reputation Points: 13
Solved Threads: 11
 

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....

tomato.pgn
Posting Whiz in Training
262 posts since Mar 2011
Reputation Points: 4
Solved Threads: 32
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: