当前位置:首页 » 密码管理 » 获取访问者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

热点内容
java返回this 发布:2025-10-20 08:28:16 浏览:593
制作脚本网站 发布:2025-10-20 08:17:34 浏览:888
python中的init方法 发布:2025-10-20 08:17:33 浏览:581
图案密码什么意思 发布:2025-10-20 08:16:56 浏览:765
怎么清理微信视频缓存 发布:2025-10-20 08:12:37 浏览:684
c语言编译器怎么看执行过程 发布:2025-10-20 08:00:32 浏览:1013
邮箱如何填写发信服务器 发布:2025-10-20 07:45:27 浏览:255
shell脚本入门案例 发布:2025-10-20 07:44:45 浏览:114
怎么上传照片浏览上传 发布:2025-10-20 07:44:03 浏览:806
python股票数据获取 发布:2025-10-20 07:39:44 浏览:712