<%
'===================================================================
'FunctionForpjBlog2
'更新时间: 2006-6-2
'===================================================================
'*************************************
'防止外部提交
'*************************************
functionchkpost ()
dimserver_v1, server_v2
chkpost = false
server_v1 = cstr (request.serverVariable ("http_referer"))
server_v2 = cstr (request.serverVariable ("server_name"))
IFMID (server_v1,8, len (server_v2)) <> server_v2then
chkpost = false
kalau tidak
chkpost = true
endif
fungsi endfungsi
'*************************************
'Ip 过滤
'*************************************
FunctionMatchip (IP)
OnerrorresumeNext
Matchip = false
Dimsip, splitip
ForeachSipInfilTerip
Sip = ganti (sip, "*", "/d*")
Splitip = split (sip, ".")
Dimre, Strmatchs, Strip
Setre = newregexp
re.ignorecase = true
re.global = true
re.pattern = "(" & splitip (0) & "|)." & "(" & splitip (1) & "|)." & "(" & splitip (2) & "|)." & "(" & splitip (3) & "|)"
SetStrmatchs = re.execute (IP)
strip = strmatchs (0) .submatches (0) & "." & Strmatchs (0) .submatches (1) & "." & Strmatchs (0) .submatches (2) & "." & Strmatchs (0) .submatches (3)
ifstrip = ipthenmatchip = true: ExitFunction
SetStrmatchs = tidak ada
Setre = tidak ada
Berikutnya
fungsi endfungsi
'*************************************
'获得注册码
'*************************************
FunctionGetCode ()
getCode = "<imgsrc =" "common/getCode.asp" "alt =" "" "" style = "" margin-right: 40px; ""/> "
Fungsi endfungsi
'*************************************
'限制上传文件类型
'*************************************
FunctionIsValidFile (file_type)
IsValidFile = false
Dimgname
Foreachgnameinup_filetype
Iffile_type = gnamethen
IsValidFile = true