Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    web link counter

    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.

  • #2
    Regular Coder Rappa's Avatar
    Join Date
    Nov 2005
    Location
    LI
    Posts
    356
    Thanks
    21
    Thanked 9 Times in 9 Posts
    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.

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,966
    Thanks
    0
    Thanked 236 Times in 233 Posts
    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.
    Code:
    <a href="linkcounter.asp?url=mypage.htm">my page</a>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •