得不到IP地址?
函数如下:
Function GetRealIP()
dim userip
userip=request.ServerVariables( "HTTP_X_FORWARDED_FOR ")
if userip= " " then userid=Request.ServerVariables( "REMOVE_ADDR ")
GetRealIP=userip
End Function
调用其函数
userip=GetRealIP()
为何userip为空值呢?谢谢
------解决方案--------------------是Request.ServerVariables( "REMOTE_ADDR ")吧
------解决方案--------------------Function GetRealIP()
GetRealIP=request.ServerVariables( "HTTP_X_FORWARDED_FOR ")
if GetRealIP= " " then GetRealIP=Request.ServerVariables( "REMOTE_ADDR ")
End Function
conn.execute( "update bbs_users set LastLoginIP= ' "&GetRealIP& " ',LastLoginTime= ' "&now()& " ',LoginTimes=LoginTimes+1 where UserID= "&rs( "UserID "))