954,598 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to track image link click and view?

Hi,guys,I need some advice on building image link counter and image display counter.


1.I need to know how to track each time the image display counter(should be something like this $counter .= $counter + 1), the image display counter only increase for unique visitor.Is that log the counter into text file better or store in the database better(this counter will keep updating the database or the counter log file)?

2.I need to know how to track whether the link of the image is click or not by the visitor,if click by visitor then only i update the counter click for the related image,
can anyone show me some code to do this kind of click counter when the visitor click the image link?


Kindly give any sample code / reference for the 2 situation above.Thanks in advance.

RGS,
Stanley

stanley87
Light Poster
43 posts since Aug 2010
Reputation Points: 10
Solved Threads: 2
 

I would store your information in a database - much easier to work with if you want to use the number of clicks for anything in particular.

With regard to clicking on the image you would need to use either javascript with an onclick() event to count or send the user (without them knowing) to another page when they click the image and use this page to update the count and then database then forward to the actually image / image page.

simplypixie
Posting Pro in Training
447 posts since Oct 2010
Reputation Points: 116
Solved Threads: 82
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: