<%
'===========================================================
'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_v2到达
chkpost = false
别的
chkpost = true
Endif
最终功能
**************************************************************************************************************************************************
'ip过滤
**************************************************************************************************************************************************
功能matchip(ip)
Onorresumenext
matchip = false
dimsip,splitip
foreachsipinfilterip
sip =替换(sip,“*”,“/d*”)
splitip = split(sip,“。”)
Dimre,strmatchs,条带
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)&“。
ifstrip = ipthenmatchip = true:出口
setstrmatchs =没有
setre =没有
下一个
最终功能
**************************************************************************************************************************************************
'获得注册码
**************************************************************************************************************************************************
functiongode()
getCode =“ <imgsrc =”“ common/getcode.asp”“ alt =”“”“ style =”“ margin-right:40px;”“/>”
最终功能
**************************************************************************************************************************************************
'限制上传文件类型
**************************************************************************************************************************************************
functionIsvalidFile(file_type)
Isvalidfile = false
dimgname
foreachgnameinup_filetype
iffile_type = gnamethen
Isvalidfile = true