-
-
ฟังก์ชั่น: userip ()
'พารามิเตอร์: ไม่มี
'ผู้แต่ง: Alixi
'วันที่: 2007/7/12
'คำอธิบาย: รับที่อยู่ IP ของไคลเอ็นต์
'ตัวอย่าง: <%= userip ()%>
-
functionUserip ()
dimgetClientip
'หากไคลเอน
getClientip = request.serverVariables ("http_x_forwarded_for")
ifgetClientip = "" orisnull (getClientip) orisEmpty (getClientip) แล้ว
'หากไคลเอน
getClientip = request.serverVariables ("remote_addr")
endif
userip = getClientip
endfunction
-
แปลงฟังก์ชั่นที่อยู่ IP
การคัดลอกรหัสมีดังนี้:
-
-
'ฟังก์ชั่น: CIP (SIP)
'พารามิเตอร์: SIP, ที่อยู่ IP
'ผู้แต่ง: Alixi
'วันที่: 2007/7/12
'คำอธิบาย: แปลงฟังก์ชั่นที่อยู่ IP
'ตัวอย่าง: <%= CIP ("219.16.73.120")%>
-
functioncip (SIP)
เคล็ดลับ = CSTR (SIP)
sip1 = ซ้าย (ปลาย, cint (instr (tip, ".")-1))
เคล็ดลับ = กลาง (เคล็ดลับ, cint (instr (เคล็ดลับ, ".")+1)))
sip2 = ซ้าย (ปลาย, cint (instr (tip, ".")-1))
เคล็ดลับ = กลาง (เคล็ดลับ, cint (instr (เคล็ดลับ, ".")+1)))
sip3 = ซ้าย (ปลาย, cint (instr (tip, ".")-1))
sip4 = mid (ปลาย, cint (instr (tip, ".")+1))
CIP = CINT (SIP1)*256*256*256+CINT (SIP2)*256*256+CINT (SIP3)*256+CINT (SIP4)
endfunction
-