📄 function.asp
字号:
Select Case FType
Case 1
Re.Pattern="<" & TagName & "([^>])*>"
ConStr=Re.Replace(ConStr,"")
Case 2
Re.Pattern="<" & TagName & "([^>])*>.*?</" & TagName & "([^>])*>"
ConStr=Re.Replace(ConStr,"")
Case 3
Re.Pattern="<" & TagName & "([^>])*>"
ConStr=Re.Replace(ConStr,"")
Re.Pattern="</" & TagName & "([^>])*>"
ConStr=Re.Replace(ConStr,"")
End Select
ScriptHtml=ConStr
Set Re=Nothing
End Function
function nohtml(byval str)
if isnull(str) or trim(str)="" then
nohtml=""
exit function
end if
dim re
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="(\<.[^\<]*\>)"
str=re.replace(str,"")
re.Pattern="(\<\/[^\<]*\>)"
str=re.replace(str,"")
set re=nothing
str=replace(str,chr(34),"")
str=replace(str,"'","")
nohtml=str
end function
Function FpHtmlEnCode(fString)
If IsNull(fString)=False or fString<>"" or fString<>False Then
fString = Replace(fString," ","")
fString = Replace(fString," "," ")
fString = Replace(fString," "," ")
fString = Replace(fString,""","")
fString = Replace(fString,"'","")
fString = replace(fString, ">", "")
fString = replace(fString, "<", "")
fString = Replace(fString, CHR(9), " ")
fString = Replace(fString, CHR(10), "")
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(34), "")
fString = Replace(fString, CHR(32), " ")
fString = Replace(fString, CHR(39), "")
fString = Replace(fString, CHR(10) & CHR(10),"")
fString = Replace(fString, CHR(10)&CHR(13), "")
fString=Trim(fString)
FpHtmlEnCode=fString
Else
FpHtmlEnCode=""
End If
End Function
Function MakeRandom(ByVal maxLen)
Dim strNewPass
Dim whatsNext, upper, lower, intCounter
Randomize
For intCounter = 1 To maxLen
upper = 57
lower = 48
strNewPass = strNewPass & Chr(Int((upper - lower + 1) * Rnd + lower))
Next
MakeRandom = strNewPass
End Function
Function Admin_ShowErr(ErrMsg,ErrorUrl,ErrType)
Select Case ErrType
Case 0
ErrTitle="操作失败"
ErrLeft="×"
Case 1
ErrTitle="操作成功"
ErrLeft="√"
End Select
Response.Write"<table width=""100%"" height=""60%"" border=0 align=""center"" cellpadding=1 cellspacing=0>" &vbcrlf
Response.Write"<tr>" &vbcrlf
Response.Write"<td>" &vbcrlf
Response.Write"<TABLE class=table cellSpacing=1 cellPadding=3 width=""60%"" align=center border=0>" &vbcrlf
Response.Write"<TBODY>" &vbcrlf
Response.Write"<TR>" &vbcrlf
Response.Write"<TD class=xingmu colSpan=3 colspan=2>"&ErrTitle&"</TD>" &vbcrlf
Response.Write"</TR>" &vbcrlf
Response.Write"<TR>" &vbcrlf
Response.Write"<TD class=""hback"" width=""15%"" height=""10"" align=""center""><font style=""font-size:30px;color: #FF0000;""><strong>"&ErrLeft&"</strong></font></TD>" &vbcrlf
Response.Write"<TD class=""hback"" align=""left"" height=""120"">"&ErrMsg&"<br><br><li><a href="&ErrorUrl&">返回上一级</a></li></TD>" &vbcrlf
Response.Write"</TR>" &vbcrlf
Response.Write"<TR>" &vbcrlf
Response.Write"<TD class=xingmu colSpan=3 height=""25"" colspan=2></TD>" &vbcrlf
Response.Write"</TR>" &vbcrlf
Response.Write"</TBODY>" &vbcrlf
Response.Write"</TABLE>" &vbcrlf
Response.Write"</td>" &vbcrlf
Response.Write"</tr>" &vbcrlf
Response.Write"</table>"
response.end
End Function
Function NoSqlHack(inputStr)
if inputStr="" then exit Function
Dim f_NoSqlHack_AllStr,NoSqlHack_Str,NoSqlHack_i,Str_InputStr
Str_InputStr=inputStr
NoSqlHack_AllStr="*|and |exec |insert |select |delete |update |count |master |truncate |declare |and |exec |insert |select |delete |update |count |master |truncate |declare |char(|mid(|chr(|and[|exec[|insert[|select[|delete[|update[|count[|master[|truncate[|declare[|set[|set |set |where[|where |where "
NoSqlHack_Str = Split(NoSqlHack_AllStr,"|")
For NoSqlHack_i=LBound(NoSqlHack_Str) To Ubound(NoSqlHack_Str)
If Instr(LCase(Str_InputStr),NoSqlHack_Str(NoSqlHack_i))<>0 Then
If NoSqlHack_Str(NoSqlHack_i)="'" Then NoSqlHack_Str(NoSqlHack_i)=" \' "
Response.Write "<html><title>警告</title><body bgcolor=""EEEEEE"" leftmargin=""60"" topmargin=""30""><font style=""font-size:16px;font-weight:bolder;color:blue;""><li>您提交的数据有恶意字符</li></font><font style=""font-size:14px;font-weight:bolder;color:red;""><br><li>您的数据已经被记录!</li><br><li>您的IP:"&Request.ServerVariables("Remote_Addr")&"</li><br><li>操作日期:"&Now&"</li></font></body></html>"
Response.End
End if
Next
NoSqlHack = Str_InputStr
End Function
Function PageUrl(moveParam,removeList)
dim strName
dim KeepUrl,KeepForm,KeepMove
removeList=removeList&","&moveParam
KeepForm=""
For Each strName in Request.Form
if not InstrRev(","&removeList&",",","&strName&",", -1, 1)>0 and Request.Form(strName)<>"" then
KeepForm=KeepForm&"&"&strName&"="&Server.URLencode(Request.Form(strName))
end if
removeList=removeList&","&strName
Next
KeepUrl=""
For Each strName In Request.QueryString
If not (InstrRev(","&removeList&",",","&strName&",", -1, 1)>0) Then
KeepUrl = KeepUrl & "&" & strName & "=" & Server.URLencode(Request.QueryString(strName))
End If
Next
KeepMove=KeepForm&KeepUrl
If (KeepMove <> "") Then
KeepMove = Right(KeepMove, Len(KeepMove) - 1)
KeepMove = Server.HTMLEncode(KeepMove) & "&"
End If
'PageUrl = replace(Request.ServerVariables("URL"),"/Search.asp","/Search.html") & "?" & KeepMove & moveParam & "="
PageUrl = "?" & KeepMove & moveParam & "="
End Function
Function fPageCount(Page_Rs,Page)
Dim This_Func_Get_Html_,toPage_,p_,sp2_,I,tpagecount
Dim NaviLength,StartPage,EndPage
showNumberLink_=10
showMorePageGo_Type_ = 0
nonLinkColor_="#999999"
toF_="<font face=webdings title=""首页"">9</font>"
toP10_=" <font face=webdings title=""上十页"">7</font>"
toP1_=" <font face=webdings title=""上一页"">3</font>"
toN1_=" <font face=webdings title=""下一页"">4</font>"
toN10_=" <font face=webdings title=""下十页"">8</font>"
toL_="<font face=webdings title=""最后一页"">:</font>"
This_Func_Get_Html_ = "" : I = 1
NaviLength=showNumberLink_
if IsEmpty(showMorePageGo_Type_) then showMorePageGo_Type_ = 1
tpagecount=Page_Rs.pagecount
If tPageCount<1 Then tPageCount=1
if not Page_Rs.eof or not Page_Rs.bof then
toPage_ = PageUrl("Page","submit,GetType,no-cache,_")
if Page=1 then
This_Func_Get_Html_=This_Func_Get_Html_& "<font color="&nonLinkColor_&" title=""首页"">"&toF_&"</font> " &vbNewLine
Else
This_Func_Get_Html_=This_Func_Get_Html_& "<a href="&toPage_&"1 title=""首页"">"&toF_&"</a> " &vbNewLine
End If
if Page<NaviLength then
StartPage = 1
else
StartPage = fix(Page / NaviLength) * NaviLength
end if
EndPage=StartPage+NaviLength-1
If EndPage>tPageCount Then EndPage=tPageCount
If StartPage>1 Then
This_Func_Get_Html_=This_Func_Get_Html_& "<a href="&toPage_& Page - NaviLength &" title=""上"&int_showNumberLink_&"页"">"&toP10_&"</a> " &vbNewLine
Else
This_Func_Get_Html_=This_Func_Get_Html_& "<font color="&nonLinkColor_&" title=""上"&int_showNumberLink_&"页"">"&toP10_&"</font> " &vbNewLine
End If
If Page <> 1 and Page <>0 Then
This_Func_Get_Html_=This_Func_Get_Html_& "<a href="&toPage_&(Page-1)&" title=""上一页"">"&toP1_&"</a> " &vbNewLine
Else
This_Func_Get_Html_=This_Func_Get_Html_& "<font color="&nonLinkColor_&" title=""上一页"">"&toP1_&"</font> " &vbNewLine
End If
For I=StartPage To EndPage
If I=Page Then
This_Func_Get_Html_=This_Func_Get_Html_& "<b>"&I&"</b>" &vbNewLine
Else
This_Func_Get_Html_=This_Func_Get_Html_& "<a href="&toPage_&I&">" &I& "</a>" &vbNewLine
End If
If I<>tPageCount Then This_Func_Get_Html_=This_Func_Get_Html_& vbNewLine
Next
If Page <> Page_Rs.PageCount and Page <>0 Then
This_Func_Get_Html_=This_Func_Get_Html_& " <a href="&toPage_&(Page+1)&" title=""下一页"">"&toN1_&"</a> " &vbNewLine
Else
This_Func_Get_Html_=This_Func_Get_Html_& "<font color="&nonLinkColor_&" title=""下一页"">"&toN1_&"</font> " &vbNewLine
End If
If EndPage<tpagecount Then
This_Func_Get_Html_=This_Func_Get_Html_& " <a href="&toPage_& Page + NaviLength &" title=""下"&int_showNumberLink_&"页"">"&toN10_&"</a> " &vbNewLine
Else
This_Func_Get_Html_=This_Func_Get_Html_& " <font color="&nonLinkColor_&" title=""下"&int_showNumberLink_&"页"">"&toN10_&"</font> " &vbNewLine
End If
if Page_Rs.PageCount<>Page then
This_Func_Get_Html_=This_Func_Get_Html_& "<a href="&toPage_&Page_Rs.PageCount&" title=""尾页"">"&toL_&"</a>" &vbNewLine
Else
This_Func_Get_Html_=This_Func_Get_Html_& "<font color="&nonLinkColor_&" title=""尾页"">"&toL_&"</font>" &vbNewLine
End If
If showMorePageGo_Type_ = 1 then
Dim Show_Page_i
Show_Page_i = Page + 1
if Show_Page_i > tPageCount then Show_Page_i = 1
This_Func_Get_Html_=This_Func_Get_Html_& "<input type=""text"" size=""4"" maxlength=""10"" name=""Func_Input_Page"" onmouseover=""this.focus();"" onfocus=""this.value='"&Show_Page_i&"';"" onKeyUp=""value=value.replace(/[^1-9]/g,'')"" onbeforepaste=""clipboardData.setData('text',clipboardData.getData('text').replace(/[^1-9]/g,''))"">" &vbNewLine _
&"<input type=""button"" value=""Go"" onmouseover=""Func_Input_Page.focus();"" onclick=""javascript:var Js_JumpValue;Js_JumpValue=document.all.Func_Input_Page.value;if(Js_JumpValue=='' || !isNaN(Js_JumpValue)) location='"&topage_&"'+Js_JumpValue; else location='"&topage_&"1';"">" &vbNewLine
Else
This_Func_Get_Html_=This_Func_Get_Html_& " 跳转:<select NAME=menu1 onChange=""var Js_JumpValue;Js_JumpValue=this.options[this.selectedIndex].value;if(Js_JumpValue!='') location=Js_JumpValue;"">"
for i=1 to tPageCount
This_Func_Get_Html_=This_Func_Get_Html_& "<option value="&topage_&i
if Page=i then This_Func_Get_Html_=This_Func_Get_Html_& " selected style='color:#FF0000'"
This_Func_Get_Html_=This_Func_Get_Html_& ">第"&cstr(i)&"页</option>" &vbNewLine
next
This_Func_Get_Html_=This_Func_Get_Html_& "</select>" &vbNewLine
End if
This_Func_Get_Html_=This_Func_Get_Html_& p_&sp2_&" 每页<b>"&Page_Rs.PageSize&"</b>个记录,现在是:<b><span class=""tx"">"&sp2_&Page&"</span>/"&tPageCount&"</b>页,共<b><span id='recordcount'>"&sp2_&Page_Rs.recordCount&"</span></b>个记录。"
else
end if
fPageCount = This_Func_Get_Html_
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -