%
' Value for the url being requested
url=trim(request.querystring("url"))
' if no url is detected then show then
' show a page with links
if url="" then %>
Cliques no TON pelo Click Carros
<%
' if there is a url value detected add it to the db
' and redirect the browser to the url
else
%>
<%
' Varible for the PC IP address
ip=request.servervariables("remote_addr")
' name of the db that will track the clicks
accessdb="clicks.mdb"
' 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
rs.open sql, cn
' kill the recordset
set rs=nothing
' redirect to the url
response.redirect url
%>
<% end if ' end check for a url value %>