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]
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]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.