| | |
PHP hit counter
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
We aren't here to programm for you, we are here to help you program. Do you have any knowledge of PHP?
Posts should be like mini-skirts, long enough to cover enough, but not too long that you cover too much.
My Liveperson: http://liveperson.com/josh-connerty/
My Liveperson: http://liveperson.com/josh-connerty/
Post your counter and I will take a look at it.
Posts should be like mini-skirts, long enough to cover enough, but not too long that you cover too much.
My Liveperson: http://liveperson.com/josh-connerty/
My Liveperson: http://liveperson.com/josh-connerty/
•
•
Join Date: Apr 2008
Posts: 75
Reputation:
Solved Threads: 3
ill tell you the logic/alogrithm of what you can do.
use cookies or sessions but using cookies is better then you can record unique users. u create a cookie, and that cookie gets saved in ur computer's hard drive. delete the cookie after every 24 hours. you can set this when you create the cookie.
when u come back again check if the cookie exists or not. if it does then your visit will not be recorded as youhave already visited that day. if the cookie does not exist then your visit will be logged as it will be your first visit that day.
now convert this logic/algorithm into code.
use cookies or sessions but using cookies is better then you can record unique users. u create a cookie, and that cookie gets saved in ur computer's hard drive. delete the cookie after every 24 hours. you can set this when you create the cookie.
when u come back again check if the cookie exists or not. if it does then your visit will not be recorded as youhave already visited that day. if the cookie does not exist then your visit will be logged as it will be your first visit that day.
now convert this logic/algorithm into code.
If one has not had the chance to do assembly prgramming then he has not had the chance to do programming at all.
Google 'php page counter' - script bunny heaven. Hotscripts and Sourceforge have loads of amazing free stuff, but some of them tend to be a little over-the-top for what you need.
You could cookify it like suggested above or your best bet would be a total MySQL solution. However, you'll need to "bone up" a bit on your php for this.
You could cookify it like suggested above or your best bet would be a total MySQL solution. However, you'll need to "bone up" a bit on your php for this.
"...the woods would be a very silent place if no birds sang except for the best"
All opinions count - unless you're a serial downvoter.
F'enw i yw Mr. Blaidd. Byddwch yn ofalus - dwi'n cnoi.
All opinions count - unless you're a serial downvoter.
F'enw i yw Mr. Blaidd. Byddwch yn ofalus - dwi'n cnoi.
•
•
•
•
no actually I can't create a counter that will count every user...my counter count on every reload...thats why...
•
•
•
•
that will count every user's click...plzz give with database & code...
If you're counting clicks, then you most likely want the number of hits on php or html files. They are the same as clicks.
If you want unique visitors, then you need cookies like mentioned by mustafaneguib. There are already existing solutions:
eg: http://piwik.org/
Or services that provide visitor analysis such as google analytics.
A lot of this information is already available in the server logs, if you have a access logs enabled.
There are many existing parsers for server logs that display the log data visually.
eg:
http://www.webalizer.org/
http://awstats.sourceforge.net/
Usually, these are already existing on PHP enabled servers and is already built into CPanel .
Website statistics generated from log analysis do not contain visitor counts, or visit counts. This is because a visitor can only be identified well by a cookie (or other client side storage). IPs cannot be used since some users have dynamic IPs and some groups of users can use a single IP.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
Similar Threads
- ASP .NET hit counter? (ASP.NET)
- PHP Hit Counter ISSUES. (PHP)
- stat hit counter HELP (PHP)
- Hit counter (JavaScript / DHTML / AJAX)
- PHP Server-Side Hit Counter for Beginner (PHP)
- Tut : Make Your-Self a IP Showing Siggy & hit counter (PHP)
Other Threads in the PHP Forum
- Previous Thread: php table with random numbers and finding max
- Next Thread: question of the day
| Thread Tools | Search this Thread |
apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql number oop parameter paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white wordpress xml youtube






