That depends.
Is the web page built in .asp or asp.net (.aspx)?
You would need to use an onclick event but the problem is that unless the site is built in asp.net the onclick event can only be captured in javascript on a regular HTML or .asp page.
The other option is if it is classic asp (.asp) you can instead have the link point to one of your own pages (say Process.asp) that is a redirect handler, and write out the counts before directing them.
So if you set up a series of links and assign them an code each of your links would start to look like this:
Process.asp?linkid=01
Process.asp?linkid=02
Then on the process page just do this
-
-
'Process.asp
-
dim MyLinkCode
-
MyLinkCode = request.querystring("linkid")
-
-
Select Case MyLinkCode
-
Case "01"
-
'CNN.com
-
sql = "insert into MyTable (name,date) VALUES ('cnn.com',Date)"
-
dbconn.execute sql
-
'then you actually send them to the page
-
response.redirect("http://www.cnn.com")
-
Case "02"
-
'bytes.com
-
sql = "insert into MyTable (name,date) VALUES ('bytes.com',Date)"
-
dbconn.execute sql
-
'then you actually send them to the page
-
response.redirect("http://www.bytes.com")
-
End Select
-
If you are in fact using asp.net for your pages you could do this a different way by using the asp.net link controls, and use the onclick event to capture the users click, rather then redirecting them.