...

View Full Version : web link counter



pgmr1998
02-27-2007, 09:15 PM
I have a web page containing a collection of links. On one link I want to keep a count of the number of times this particular link has been clicked on or visited. I thought that the thing to do is:
1) have the link invoke a javascript program
2) the javascript program would update an access db and increment a counter field
3) javascript program calls the web page, so that the web page appears in the same browser window. The user never knows or sees that a count is being kept.

Rappa
02-27-2007, 09:36 PM
that sounds like it would work. why not try it yourself first? then if you have problems post what youve made and we can correct it.

glenngv
02-27-2007, 09:53 PM
The better solution is to make the link refer to a server-side script passing the url or url id of the clicked link. In the server-side code, update the database based on the passed url or url id. After the update is completed, redirect to the passed url.

<a href="linkcounter.asp?url=mypage.htm">my page</a>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum