<%
'======================================================================
'FunctionForpjblog2
'更新时间: 2006-6-2
'======================================================================
'***********************************
'防止外部提交
'***********************************
functionchkpost ()
dimserver_v1, server_v2
chkpost = false
server_v1 = cstr (request.servervariables ("http_referer")))))
server_v2 = cstr (request.servervariables ("server_name"))))
Ifmid (server_v1,8, len (server_v2)) <> server_v2then
chkpost = false
еще
chkpost = true
эндиф
конечная функция
'***********************************
'IP 过滤
'***********************************
functionMatchip (ip)
OnerRorResumenext
Matchip = false
Dimsip, Splitip
foreachsipinfilterip
SIP = заменить (sip, "*", "/d*")
Splitip = split (sip, ".")
Dimre, Strmatchs, Strip
Setre = newRegexp
re.ignorecase = true
re.global = true
re.pattern = "(" & splitip (0) & "|)." & "(" & splitip (1) & "|).
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 = ничего
Setre = ничего
следующий
конечная функция
'***********************************
'获得注册码
'***********************************
FunctiongetCode ()
getCode = "<imgsrc =" "common/getCode.asp" "alt =" "" style = "" Право маржи: 40px; "/>"
Конечная функция
'***********************************
'限制上传文件类型
'***********************************
Functionisvalidfile (file_type)
Isvalidfile = false
Dimgname
Foreachgnameinup_filetype
Iffile_type = gnamethen
Isvalidfile = true