-
-
'ฟังก์ชั่น: getUserTrueip ()
'พารามิเตอร์: ไม่มี
'ผู้แต่ง: Alixi
'วันที่: 2007/7/13
'คำอธิบาย: รับ IP จริงของผู้ใช้และยังคงใช้ได้สำหรับที่อยู่พร็อกซี ค่าส่งคืน: ที่อยู่ประเภทข้อความ IP
'ตัวอย่าง: <%= getUserTrueip ()%>
-
functiongetUserTrueip ()
dimstripaddr
ifrequest.serverVariables ("http_x_forwarded_for") = "" orinstr (request.serverVariables ("http_x_forwarded_for"), "ไม่ทราบ")> 0 จากนั้น
stripaddr = request.serverVariables ("remote_addr")
elseifinstr (request.serverVariables ("http_x_forwarded_for"), ",", ",")> 0 แล้ว
stripaddr = mid (request.serverVariables ("http_x_forwarded_for"), 1, instr (request.serverVariables ("http_x_forwarded_for"), ",")-1)
elseifinstr (request.serverVariables ("http_x_forwarded_for"), ";")> 0 แล้ว
stripaddr = mid (request.serverVariables ("http_x_forwarded_for"), 1, instr (request.serverVariables ("http_x_forwarded_for"), ";")-1)
อื่น
stripaddr = request.serverVariables ("http_x_forwarded_for")
endif
getUserTrueip = trim (mid (stripaddr, 1,30))
endfunction
-