Jump to content

Hit counter?


Fmdpa

Recommended Posts

I know a cookie can be created to make a personal "You have visited this page x times before" statement, but it is possible, using JavaScript to create a total web page hit counter, eg "This page has been viewed x times"?Also, something random I've been wondering is if foreign programmers have Spanish JavaScript, for example, or is all web programming done in English?

Link to comment
Share on other sites

You can't use JavaScript, as you would need to store the count for your global counter on the server, which requires the use of a server-side language.As for your second questions, I'm sure programmers working in languages other than English may use foreign variable names, etc., but the keywords will still be in English.

Link to comment
Share on other sites

Page counter tools are all server-side units. If you have no server-side scripting skills, you may actually have some software to do this pre-installed on your host. If not, there are many tools you can download for free that are easily configured.Virtually all programming languages are written in English, and even if they weren't, the API (interface) that joins the language to the platform will likely be written in English. You are certainly free to use variable names in your native language. On this board we are frequently asked to evaluate code filled with content and variable names that I do not understand. I'm sure it is frustrating, but that is the marketplace. It has always been so.

Link to comment
Share on other sites

I haven't heard of doing this with a Cookie.. Well, I have, but it only displays the number of times that particular user has been to that site, only displays it for that user and is useless for any kind of tracking. Most decent counters that I've seen contain a .dat file, this file contains nothing but a number. Every time someone goes to the site, the file is opened and a 1 is added to the number, the results are displayed in the counter on the screen and also saved to the .dat file replacing the old number. Javascript does not have the ability to open and modify the .dat file, therefore, javascript is not usable for this purpose. PHP may be your best bet and there are several free counters online that you can apply your own styling to. Just be careful as a lot of them (as with much commercially "free" code) actually have a subroutine in their code that counts and collects data on YOU!I am sooo glad that I work for a company that doesn't use any outsourced programmers! I can't imagine what a nightmare it would be trying to deal with code from several different areas!

Link to comment
Share on other sites

.dat isn't really the proper extension for a file that just contains a number… but you can use any extension you want.Note that even if you don't, uh, outsource your programming, you may have to work with code from multiple different people working in a team, which is why you need to define conventions and other common practices. This is why using frameworks can also be helpful.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...