|
© 1996-2008 Kansas State University College of Veterinary Medicine. Nondiscrimination Notice. |
Kansas State University • College of Veterinary Medicine • 101 Trotter Hall • Manhattan KS 66506-5601 |
<%
on error resume next
usersIP = Request.ServerVariables("REMOTE_ADDR")
set connTemp = server.createobject("adodb.connection")
connTemp.open "Driver={Microsoft Access Driver (*.mdb)};DBQ=" &server.MapPath("\cgi-bin\databases\WebCounter.mdb")&";"
connectme="Driver={Microsoft Access Driver (*.mdb)};DBQ=" &server.MapPath("\cgi-bin\databases\WebCounter.mdb")&";"
set rstemp=Server.CreateObject("adodb.Recordset")
sqlst = "SELECT * FROM vmthm WHERE uip='" &usersIP &"'"
rstemp.open sqlst, connectme
ddate1 = Date()
arrdd1 = split(ddate1,"/")
'response.write "hi" & "
"
if not rstemp.eof then
uip = rstemp("uip")
hcount = rstemp("hcount")
ddate = rstemp("ddate")
arrdd = split(ddate,"/")
'response.write arrdd1(0) &"-"& arrdd1(1) &"-"& arrdd1(2) & "
"
'response.write arrdd(0) &"-"& arrdd(1) &"-"& arrdd(2) & "
"
if (arrdd(2) <> arrdd1(2) or arrdd(1) <> arrdd1(1) or arrdd(0) <> arrdd1(0)) and hcount >= 1 then
hcount1 = hcount + 1
sqlst1 = "UPDATE vmthm SET hcount=" & hcount1 & ", ddate='" & Date() & "' WHERE uip='" &uip& "'"
end if
else
sqlst1 = "INSERT INTO vmthm (uip,hcount,ddate) VALUES ('" &usersIP& "',1,'" &Date()& "')"
end if
connTemp.execute(sqlst1)
connTemp.close
set connTemp = server.createobject("adodb.connection")
connTemp.open "Driver={Microsoft Access Driver (*.mdb)};DBQ=" &server.MapPath("\cgi-bin\databases\WebCounter.mdb")&";"
connectme="Driver={Microsoft Access Driver (*.mdb)};DBQ=" &server.MapPath("\cgi-bin\databases\WebCounter.mdb")&";"
set rstemp=Server.CreateObject("adodb.Recordset")
sqlst = "SELECT * FROM vmth_an WHERE uip='" &usersIP &"'"
rstemp.open sqlst, connectme
ddate1 = Date()
arrdd1 = split(ddate1,"/")
'response.write "hi" & "
"
if not rstemp.eof then
uip = rstemp("uip")
hcount = rstemp("hcount")
ddate = rstemp("ddate")
arrdd = split(ddate,"/")
'response.write arrdd1(0) &"-"& arrdd1(1) &"-"& arrdd1(2) & "
"
'response.write arrdd(0) &"-"& arrdd(1) &"-"& arrdd(2) & "
"
if (arrdd(2) <> arrdd1(2) or arrdd(1) <> arrdd1(1) or arrdd(0) <> arrdd1(0)) and hcount >= 1 then
hcount1 = hcount + 1
sqlst1 = "UPDATE vmth_an SET hcount=" & hcount1 & ", ddate='" & Date() & "' WHERE uip='" &uip& "'"
end if
else
sqlst1 = "INSERT INTO vmth_an (uip,hcount,ddate) VALUES ('" &usersIP& "',1,'" &Date()& "')"
end if
connTemp.execute(sqlst1)
connTemp.close
connectme="Driver={Microsoft Access Driver (*.mdb)};DBQ=" &server.MapPath("\cgi-bin\databases\WebCounter.mdb")&";"
set rstemp=Server.CreateObject("adodb.Recordset")
sqlst = "Select SUM(hcount) as csum from vmth_an"
rstemp.open sqlst, connectme
if not rstemp.eof then
count1 = rstemp("csum")
response.write count1 &" hits since December 7, 2004"
end if
%>