private function getip()
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)
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)
else
stripaddr = request.servervariables("http_x_forwarded_for")
end if
getip = trim(mid(stripaddr, 1, 30))
end function
