• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

JavaScript Counter

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Has anybody got any java script code that will count
how many hit's my site is getting.
My site runs of a unix server.
Ps I'm new to java script.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If possible, it's best to use a cgi script. Most web site hosts provide a few cgi script that you can use on your site. A page hit counter is usually one that is offerd along with form mail handlers and guestbook handlers.
Otherwise, I found this site that will probably do the trick, http://wwwx.nbci.com/counter/
 
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Javascript probably isn't the solution. In order to count how many users have hit your site, you need to keep a value for each and every user, and you need to keep this on the server. Javascript is a client side scripting language, so it doesn't really look at session values. You can try server side javascript, but I have never done that. I have done counters using ASP (windows) and CGI (unix), and that is probably the easiest and will cause the least amount of problems.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic