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

Php counter

hi all,
I am a new learner of php. I m currently working on my 1st php project.project is all about a website development.The site is still underdevelopment. I want to include counter in m website in order to know the number of visitors.I am continuously searching for a snippet.Please help!!

maunica
Newbie Poster
20 posts since May 2010
Reputation Points: 10
Solved Threads: 0
 
hi all, I am a new learner of php. I m currently working on my 1st php project.project is all about a website development.The site is still underdevelopment. I want to include counter in m website in order to know the number of visitors.I am continuously searching for a snippet.Please help!!

Sorry! No snippets here, but you will need two things:
The PHP connection handling ; http://us3.php.net/manual/en/features.connection-handling.php

...and a database to be incremented with each connect.

JRM
Practically a Master Poster
621 posts since Nov 2006
Reputation Points: 130
Solved Threads: 75
 

Another possibility: If your pages are all dynamic pages pulled from content stored in a database, add a "hits" field to the table where you store the page content. Then every time a page is requested, increment the number in that field for that page. You will know how many times each page was hit, and you can easily do a query to total those hits (SUM) for a total visits number. Of course, this approach falls apart if not all your pages can be tracked that way.

coppercup
Newbie Poster
11 posts since May 2009
Reputation Points: 11
Solved Threads: 2
 
almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376
 

Thank you soo much for help..

maunica
Newbie Poster
20 posts since May 2010
Reputation Points: 10
Solved Threads: 0
 

By php user counter you mean.. You have registered users on your site..

you want to count the number of registered logged in users
or
you want to count the number of just normal visitors ?

hellojohnatan
Newbie Poster
10 posts since Apr 2011
Reputation Points: 9
Solved Threads: 0
 
http://innovativetechnologyconcepts.com/


I downloaded the script but i don't get how to use it.
100% working?

hellojohnatan
Newbie Poster
10 posts since Apr 2011
Reputation Points: 9
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You