PDA

View Full Version : Help with Web development.



Jonny87
April 28th, 2011, 10:26 AM
I've recently been teaching myself HTML CSS and now starting on Javascript. But I'm looking for a something in particular at the moment and thought that theres bound to be someone on her who can help.

I after a vistor counter that will count all visitors except the Webmaster/Owner of the page.

Also a counter that will keep track of how many times a file downloaded from the site.

RiceMonster
April 28th, 2011, 12:35 PM
A visitor counter needs to be done with a server side language such as PHP.

SeijiSensei
April 28th, 2011, 02:24 PM
You can count the number of downloads of an object from the command line using the Apache logs:


grep 'file.name' /var/log/apache2/access.log | wc -l

returns the number of times "file.name" appears in the access log.

If your logs are rotated (so you have files like /var/log/apache2/access.log.1 and so forth) you'll need to replace "access.log" with "access.log*" in the command above.

If you want to display this value on a web page, you'll again need to use a scripting language like PHP.