- ASP - Read/Write
·Script Writers
·Database Display
·Response Objects
·Server Variables
·Random Events
·What's New?
Mail List


Count Click Throughs (With a Db)
Need to track where your users are clicking to from your site? Easily count and display the number of click through from your site with a database. Simply set all the links that you want to track to a single asp document and pass the URL as a querystring variable. The following example will display a page with a few links. Once a link is clicked on it will insert the URL and users IP address into an Access Db and redirect the browser to the URL clicked on. Included in the download is a document that will allow you to view people are clicking to in a number of ways.
View the Output
Text View
Print View
Mail this Link
Download the Code

' Value for the url being requested

' if no url is detected then show then
' show a page with links 
if url="" then %>

<title> Clicks to a Db)</title>
<body bgcolor="#FFFFFF">

<a href="clicks.asp?url=">Yahoo</a>
<a href="clicks.asp?url=">AOL</a>
<a href="clicks.asp?url=">Excite</a>
<a href="clicks.asp?url=">Mail2Web</a>
<a href="clicks.asp?url=">ASPIn</a>
<a href="clicks.asp?url=">SAS</a>

' if there is a url value detected add it to the db
' and redirect the browser to the url


' Varible for the PC IP address

' name of the db that will track the clicks

' Build a connection to the db
cn="DRIVER={Microsoft Access Driver (*.mdb)};"
cn=cn & "DBQ=" & server.mappath(accessdb)

' Create a server record set object
set rs = server.createobject("ADODB.Recordset")

' SQL statement that will insert the url and the ip address
sql = "insert into clicks (url,ip) values('"& url &"','"& ip &"')" 

' insert the values into the db sql, cn

' kill the recordset 
set rs=nothing

' redirect to the url 
response.redirect url 

<% end if ' end check for a url value %>




ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement is hosted by
    Donate Food Online with a Mouse Click at
    Donate Land Online with a Mouse Click at
    © 1999 - 2018
    All Rights Reserved

  • Kids jordan 6 rings
  • Jordan retro 10
  • Jordan retro 3