<%
'================================================================================
'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
endif
エンド機能
'***********************************
'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)& "|)。"& "("&splitip(2)& "|)。"& "("&splitip(3)& "|)"
setStrMatchs = re.execute(ip)
strip = strmatchs(0).submatches(0)& "。"&strmatches(0).submatches(1)& "。"&strmatchs(0).submatches(2)& "。"&strmatches(0).submatches(3)
ifstrip = ipthenmatchip = true:exitFunction
SetStrMatchs =何もない
setre =何もない
次
エンド機能
'***********************************
'获得注册码
'***********************************
functiongetCode()
getCode = "<imgsrc =" "common/getcode.asp" "alt =" "" "style =" "margin-right:40px;" "/>"
エンド機能
'***********************************
'限制上传文件类型
'***********************************
functionisvalidfile(file_type)
isvalidfile = false
dimgname
foreachgnameinup_filetype
iffile_type = gnamethen
isvalidfile = true