<%

session("lastdate") = Request.Cookies("tgdate")
session("lastid") = Request.Cookies("ID")
url = Request.QueryString("id")
Response.Cookies("ID") = url

Conn_String = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("jgwy/jgwy.mdb")
	
set conn = Server.CreateObject("ADODB.Connection")
conn.open Conn_String
Set RS = conn.Execute("select * from link2 where ID =" & url)
ezeRedir = RS("URL").value


if session("lastdate") = "" then
	session("lastdate") = dateadd("d",-10,now())
End if
ezedate =  datediff("h",session("lastdate"), now())

if  session("lastid") = url  and ezedate < 6 then
else
	hit=cInt(rs("Hit"))+1
Set RS2 = conn.Execute("UPDATE link2 SET Hit = " & hit & " Where ID =" & url)
	
	End If


RS.Close
conn.Close
set conn = nothing


Response.Redirect (ezeredir)
%>
