Jump to content

Hit Counter


alwaysvaghu

Recommended Posts

Well, javascript might be the language that is used, but it alone will not be able to provide a solution. It is only a client-side language so it will not be able to store anything cumulative for a website without interacting with something else.I'm not a fan of hit counters since they really don't fairly represent site traffic and they can be easily manipulated to produce inaccurate results. But, if you insist on having one just google "free hit counters" and you'll be inondated with plenty of options.If you're hosting provider doesnot offer web statistics, then consider this tool:http://pphlogger.phpee.com/its a great little tool I've used in the past.Good Luck

Link to comment
Share on other sites

Skemcin is right you won't be able to produce a hit counter with javascript as this is a client-side language and has no way of saving information that you can access.You would need to use a server-side language like php for example and link it to a file or databases that adds 1 to a variable each time the page is requested.

Link to comment
Share on other sites

I don't see how you can even use javascript at all, it can't talk to a databse or anything.You need a database and a server side language like ASP.Net or php.I agree that counters can be easily manipulated, if they are written wrong! They should only log unique visitors (ipaddress) and not muliple hits to the same page, by the same user, every couple minutes.

Link to comment
Share on other sites

well, javascript is used in conjunction with many hit counters. javascript, since it is loaded client side, can execute when the page loads and call an external script(php, asp, or cold fusion) that runs on a remote server. All the magic is done in that remote file that the javascript calls. This, infact, is what pphlogger does. It passes the counter account id to the php page (via javascript) and then based on that call, the php code extracts everything it can and databases it. It is optional, in pphlogger, to display the counter.All in all, its as I stated before, javascript CAN be used for a hit counter but it CANNOT do it all alone. Adding to that, as real_illusions points out, you could (for what ever reason) create a fake hit counter with javascript.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...