| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 758 人关注过本帖
标题:帮忙看看代码!
取消只看楼主 加入收藏
wyjx
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2007-8-19
收藏
 问题点数:0 回复次数:0 
帮忙看看代码!
程序代码:
Function IP()
        Dim strIPAddr 
        If Request.ServerVariables("HTTP_X_FORWARDED_FOR") = "" OR InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), "unknown") > 0 Then 
            strIPAddr = Request.ServerVariables("REMOTE_ADDR") 
        ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",") > 0 Then 
            strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",")-1) 
            actforip=Request.ServerVariables("REMOTE_ADDR")
        ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";") > 0 Then 
            strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";")-1)
            actforip=Request.ServerVariables("REMOTE_ADDR")
        Else 
            strIPAddr = Request.ServerVariables("HTTP_X_FORWARDED_FOR") 
            actforip=Request.ServerVariables("REMOTE_ADDR")
        End If 
        IP = Trim(Mid(strIPAddr, 1, 30))
End Function

这能不能简略一些代码?
我有一个IP数据库,用什么代码来得转换IP到相应的页面?
数据库字段有  Startip   Endip  country  ReUrl 四个字段
搜索更多相关主题的帖子: Request FORWARDED HTTP InStr strIPAddr 
2008-07-05 12:46
快速回复:帮忙看看代码!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011842 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved