ASP中input value值如何获取access中字段值
<%IP=Request.ServerVariables("HTTP_X_FORWARDED_FOR")IfIP=""orIsNull(IP)ThenIP=Request...
<%
IP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If IP = "" or IsNull(IP) Then IP = Request.ServerVariables("REMOTE_ADDR")
'判断当前来访者所属地区的函数
function getaddress(ip)
ipstr=split(ip,".")
'计算当前来访者IP
num=int(ipstr(0))*256*256*256+int(ipstr(1))*256*256+int(ipstr(2))*256+int(ipstr(3))-1
db="ip_address.mdb"
set conn=server.createobject("adodb.connection")
conn.open "provider=microsoft.jet.oledb.4.0;data source="&server.mappath(db)
set rs=server.createobject("adodb.recordset")
rs.open "select * from pe_ip where "&num&">=ip1 and "&num&"<=ip2",conn,1,1
if not rs.eof then
'输出判断结果
<input name="userip" value="%=rs("Address")%" size="20" maxlength="50" />
response.write rs("Address")
end if
rs.close
end function
getaddress(ip)
%> 展开
IP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If IP = "" or IsNull(IP) Then IP = Request.ServerVariables("REMOTE_ADDR")
'判断当前来访者所属地区的函数
function getaddress(ip)
ipstr=split(ip,".")
'计算当前来访者IP
num=int(ipstr(0))*256*256*256+int(ipstr(1))*256*256+int(ipstr(2))*256+int(ipstr(3))-1
db="ip_address.mdb"
set conn=server.createobject("adodb.connection")
conn.open "provider=microsoft.jet.oledb.4.0;data source="&server.mappath(db)
set rs=server.createobject("adodb.recordset")
rs.open "select * from pe_ip where "&num&">=ip1 and "&num&"<=ip2",conn,1,1
if not rs.eof then
'输出判断结果
<input name="userip" value="%=rs("Address")%" size="20" maxlength="50" />
response.write rs("Address")
end if
rs.close
end function
getaddress(ip)
%> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询