数据库连接出错,请检查Conn.asp文件中的数据库参数设置。 10
请问如何改conn.asp文件中的数据库参数设置,谢谢高手指教<%FunctionGet_SafeStr(str)Get_SafeStr=Replace(Replace(...
请问如何改conn.asp文件中的数据库参数设置,谢谢高手指教
<%
Function Get_SafeStr(str)
Get_SafeStr = Replace(Replace(Replace(Replace(Replace(Trim(str), "'", ""), Chr(34), ""), ";", ""),"=",""),">","")
End Function
Function IsSafeStr(str)
Dim s_BadStr, n, i
s_BadStr = "' &<>?%,;:()`~!@#$^*{}[]|+-=" & Chr(34) & Chr(9) & Chr(32)
n = Len(s_BadStr)
IsSafeStr = True
For i = 1 To n
If Instr(str, Mid(s_BadStr, i, 1)) > 0 Then
IsSafeStr = False
Exit Function
End If
Next
End Function
c=Abs(Asc(Mid(str,i,1)))
if c>255 then
t=t+2
else
t=t+1
end if
if t>=strlen then
gotTopic=left(str,i)&""
exit for
else
gotTopic=str
end if
next
gotTopic=replace(replace(replace(replace(gotTopic," "," "),chr(34),"""),">",">"),"<","<")
end function
'去除html标签
function nohtml(str)
dim re
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="(\<.[^\<]*\>)"
str=re.replace(str," ")
re.Pattern="(\<\/[^\<]*\>)"
str=re.replace(str," ")
str=replace(str," "," ")
str=replace(str," "," ")
str=replace(str," "," ")
nohtml=str
set re=nothing
end function
%> 展开
<%
Function Get_SafeStr(str)
Get_SafeStr = Replace(Replace(Replace(Replace(Replace(Trim(str), "'", ""), Chr(34), ""), ";", ""),"=",""),">","")
End Function
Function IsSafeStr(str)
Dim s_BadStr, n, i
s_BadStr = "' &<>?%,;:()`~!@#$^*{}[]|+-=" & Chr(34) & Chr(9) & Chr(32)
n = Len(s_BadStr)
IsSafeStr = True
For i = 1 To n
If Instr(str, Mid(s_BadStr, i, 1)) > 0 Then
IsSafeStr = False
Exit Function
End If
Next
End Function
c=Abs(Asc(Mid(str,i,1)))
if c>255 then
t=t+2
else
t=t+1
end if
if t>=strlen then
gotTopic=left(str,i)&""
exit for
else
gotTopic=str
end if
next
gotTopic=replace(replace(replace(replace(gotTopic," "," "),chr(34),"""),">",">"),"<","<")
end function
'去除html标签
function nohtml(str)
dim re
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="(\<.[^\<]*\>)"
str=re.replace(str," ")
re.Pattern="(\<\/[^\<]*\>)"
str=re.replace(str," ")
str=replace(str," "," ")
str=replace(str," "," ")
str=replace(str," "," ")
nohtml=str
set re=nothing
end function
%> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |