how to show how many times a pic have been viewed or clicked on?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The place to find this information is to look in your web server's "access" log.
While this is ostensibly true, not all views/clicks will come directly from your server. Caches of various sorts will supply hits that cannot be recorded in your server logs. There is know way of knowing for sure.
The server logs will tell you some things, like trends and so on. The number of hits recorded by your server should be interpreted as the minimum number of actual hits.
Most such scripts tend to be very site-specific or user-specific and the format of the log file can vary quite a bit. Give us a sample of your log file, and what your preferred language for implementation is, and someone will be able to cobble something together. Better still, take a shot on your own, and post code snippets here when you need help.
The general technique is not difficult. Usually, the web server logs are stored as records of hits, one per line, and mostly in chronological order. The various fields are fairly easy to discern by inspection.
--- rod.
just get a java script to record this somewhere.
on all anchors add the onClick="javascript:<increment count goes here>".
you don't need to search for one just make it yourself.
read this: http://www.c-point.com/JavaScript/ar...JavaScript.htm
for reading writing to files, make a function that does this, and use the onclick.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.