Click to See Complete Forum and Search --> : Javascript hit counter?


HDC
04-30-2006, 08:20 PM
Does any one know if there is such a thing as a javascript hit counter. Not sure if this is possible but I'm looking for a way to count hits on a dynamic page. Basically someone would select and display a record like: id=1234 and this script would count up by 1 and then write that number into the database under the field name "Counter". Not sure if javascript can do this or if I need to do this serverside somehow.

Thanks!

David Harrison
04-30-2006, 09:09 PM
A server side language would be required for that. The count would have to be stored on the server and nothing client side can do anything on the server.

felgall
04-30-2006, 11:46 PM
You could use Javascript and cookies to count the number of hits a particular visitor has on a page but the count would be separate for each visitor and inaccessible to anyone else. Something along the lines of:

This is your 99th visit to this page.

To count everyone in one counter and have it available foy you to see it you need something on the server.

balloonbuffoon
04-30-2006, 11:52 PM
http://statcounter.com/ has a pretty good statistics program that's free, and has tons of features. It uses javascript on the page to register the page visits in their database, but really all you have to do is sign up and put the code on your page!

--Steve

HDC
05-01-2006, 01:01 PM
Excellent guys, thanks for the suggestions!

Bytes
05-01-2006, 01:33 PM
Going along with what balloonbuffoon posted you may also want to give this site a review, used it for years and it works great, plus it free!

http://sitemeter.com

Regards,