?? my_lib.asp
字號:
<%
sub wurl(keyword,url)
Response.write "<script>alert('"&keyword&"');location.href='"&url&"';</script>"
Response.end
end sub
sub wnourl(keyword)
response.write"<SCRIPT language=JavaScript>alert('"&keyword&"');"
response.write"javascript:history.go(-1)</SCRIPT>"
end sub
sub connclose(Sconn)
Sconn.close
set Sconn=nothing
end sub
sub rsclose(Ars)
Ars.close
set Ars=nothing
end sub
Function my_request(ParaName,ParaType)
Dim ParaValue
ParaValue=Request(ParaName)
If ParaType=1 Then
If Not isNumeric(ParaValue) Then
response.write "操作失誤"
end if
Else
ParaValue=replace(ParaValue,"'","''")
End if
my_request=ParaValue
End function
Sub CreateAFolder(file)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
Fso.Createfolder(server.mappath(".."& "\"&file))
Set fso = nothing
End Sub
Sub DeleteAFolder(file)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
Fso.DeleteFolder(server.mappath(".."& "\"&file))
Set fso = nothing
End Sub
'去除部分html代碼
Function leach(str)
if str<>"" then
str=replace(replace(replace(replace(replace(str,chr(34),"""),chr(39),"'"),"<","<"),">",">"),vbCrlf,"<br>")
end if
leach=str
End function
'-------------------------------------------------------------------
'恢復部分html代碼
Function Outleach(str)
if str<>"" then
str=replace(replace(replace(replace(replace(str,""",chr(34)),"'",chr(39)),"<","<"),">",">"),"<br>",vbCrlf)
end if
Outleach=str
End function
'post過濾sql注入代防范及HTML防護開始
function nosql(str)
if not isnull(str) then
str=trim(str)
str=replace(str,";",";") '分號
str=replace(str,"'","'") '單引號
str=replace(str,"""",""") '雙引號
str=replace(str,"chr(9)"," ") '空格
str=replace(str,"chr(10)","<br>") '回車
str=replace(str,"chr(13)","<br>") '回車
str=replace(str,"chr(32)"," ") '空格
str=replace(str,"chr(34)",""") '雙引號
str=replace(str,"chr(39)","'") '單引號
str=Replace(str, "script", "script")'jscript
str=replace(str,"<","<") '左<
str=replace(str,">",">") '右>
str=replace(str,"(","(") '左(
str=replace(str,")",")") '右)
str=replace(str,"--","--") 'SQL注釋符
nosql=str
end if
end function
sub CloseConn()
rs.close
set rs=nothing
conn.close
set conn=nothing
end sub
'--------------留言本
function face(strcontent)
dim p
for p=1 to 48
strcontent=replace(strcontent,"[ssort"&p&"]"," <img src=faceimg/"&p&".gif> ")
next
face=strcontent
end function
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -