<%
'===========================================================
'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