<%
'===============================================================
'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
else
chkpost=True
endIf
endfunction
'*************************************
'IP过滤
'*************************************
functionMatchIP(IP)
onerrorresumenext
MatchIP=false
DimSIp,SplitIP
foreachSIpinFilterIP
SIp=replace(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=Nothing
Setre=Nothing
next
endfunction
'*************************************
'获得注册码
'*************************************
Functiongetcode()
getcode="<imgsrc=""common/getcode.asp""alt=""""style=""margin-right:40px;""/>"
EndFunction
'*************************************
'限制上传文件类型
'*************************************
FunctionIsvalidFile(File_Type)
IsvalidFile=False
DimGName
ForEachGNameinUP_FileType
IfFile_Type=GNameThen
IsvalidFile=True