ip = request.servervariables("remote_addr") '获取访问者的ip
now_time = now '获取登陆时间(服务器时间)
完整的代码如下
dim
conn,rs,ip,now_time
set
conn=server.createobject("adodb.connection")
dbpath =
server.mappath("数据库路径")
conn.open "driver={microsoft access driver
(*.mdb)};dbq=" & dbpath
set
rs=server.createobject("adodb.recordset")
sql = "表名"
rs.open
sql,conn,3,2
rs.addnew
ip = request.servervariables("remote_addr")
'获取访问者的ip
now_time = now '获取登陆时间(服务器时间)
rs("字段名1") = ip
rs("字段名2") = now_time
rs.update
Request.ServerVariables("REMOTE_ADDR")
Request.ServerVariables("HTTP_X_FORWARDED_FOR")
Request.ServerVariables("REMOTE_ADDR")