当前位置:首页 » 密码管理 » 获取访问者ipasp

获取访问者ipasp

发布时间: 2023-06-15 18:14:14

❶ asp中怎样获取访问者的IP地址

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

❷ ASP怎么查看在线访问者的IP地址

分类: 电脑/网络 >> 程序设计 >> 其他编程语言
问题描述:

访问者访问一个蠢含IP。ASP文件,能获得他的IP,而我们能同时从另外一个页面LOADIP。ASP文件看到他的IP,这段代码要怎么写呀,我写了出来能获得IP,但是就是我们不能同时从另外一个颤笑页面看到访问者的IP,哪位大侠能教教我!

IP。ASP 代码

<% Application.Lock()

Application("Userip") = Request.ServerVariables("HTTP_X_FORWARDED_FOR")

If Application("Userip") = "" Then Application("Userip") = Request.ServerVariables("REMOTE_ADDR")

Session("Userip")=Application("Userip")

Application.UnLock()

Response.Redirect("loadip")

%>

LOADIP。ASP代码

<%

if Session("userip") <> "" then

online=Response.IsClientConnected

online=true

userip=Session("userip")

Response.Write"<table border=1 align=center>"

Response.Write"<tr><td width=100>"

Response.Write("来访者IP:")

Response.Write"<带洞笑/td><td width=200 align=center><a href=#>"

Response.Write(userip)

Response.Write("</a></td><td>")

Response.Write(date())

Response.Write("</td></tr></table>")

else

Response.Write("<div align=center>")

Response.Write("没有来访者")

Response.Write("</div>")

end if

%>

哪里错了,哪位大哥大姐帮帮我!

解析:

没有错误,请问你是那里报错?本地和远程调试都未出现错误啊?

=============

你能解释一下“同时”是个什么意思么?

你的意思是你打开一个页面,如果有访问者登陆后,你打开的那个页面就立即显示出登陆者的IP?

❸ ASP获取ip地址

function getipadd()
ipadd=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
if ipadd= "" Then ipadd=Request.ServerVariables("REMOTE_ADDR")
getipadd=ipadd
end function

使用:
response.write getipadd

热点内容
卸载linux软件 发布:2025-03-16 03:19:07 浏览:808
太平天国迅雷下载ftp 发布:2025-03-16 03:13:19 浏览:64
服务器硬盘温度怎么调节 发布:2025-03-16 03:11:47 浏览:74
netcore编译前执行代码 发布:2025-03-16 03:05:17 浏览:475
饥荒联机版服务器搭建程序 发布:2025-03-16 02:55:18 浏览:684
win7如何访问共享 发布:2025-03-16 02:55:14 浏览:37
centosphp升级 发布:2025-03-16 02:42:04 浏览:52
绝地求生体验服为什么服务器已满了 发布:2025-03-16 02:42:03 浏览:706
服务器电脑机房是干嘛的 发布:2025-03-16 02:30:47 浏览:489
龙贝格算法c语言 发布:2025-03-16 02:26:28 浏览:102