Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting number of clicks in a link

Status
Not open for further replies.

drimades

IS-IT--Management
Nov 8, 2004
221
0
0
MK
Hi!
I have some news links in mysql db. for each link I want to keep in the db (a field ClicksNr) the number of clicks too. Any idea how to deal with this in Perl/Html?
 
The simplest way would probably be to do batch processing of your web server's access logs on a regular basis (daily, or perhaps hourly?), then update the DB accordingly.

Annihilannic
[small]tgmlify - code syntax highlighting for your tek-tips posts[/small]
 
Hi

Are those news internal or external ?
[ul]
[li]For internal links Annihilannic suggestion is perfect.[/li]
[li]For external links you will have to implement either[ul]
[li]An [tt]onclick[/tt] event handler to send a notification to your server with AJAX. [sup](*)[/sup][/li]
[li]A redirector script and link to news as /redirect.pl?url=[ignore][/ignore] . [sup](**)[/sup][/li]
[li]Same as above but using some unique identifiers as /redirect.pl?url=ad3a9ef26802637e4ee4696e7e52cfea .[/li]
[/ul][/li][/ul]
[small](*) Will not work when JavaScript is disabled or blocked. Also will not work when the link is followed without clicking it.[/small]

[small](**) Browser extensions like Redirect Remover and Redirect Cleaner for FireFox or Simple URL Filter and NoDetour for Opera will remove it.[/small]


Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top