从柠檬树网上找到一个过滤字符串的函数,我改运了一下,可是用时却提示这样的错误:
Request 对象, ASP 0102 (0x80004005)
函数需要字符串输入。
/library/include/function.asp, 第 6 行
下面是我改的函数:
Function CheckStr(in_str,in_quest,in_type)
str=in_str
Select Case in_quest
Case 1
str=Request.Form(str) (这就是第6行)
Case 2
str=Request.QueryString(str)
Case 3
str=Request.Cookies(str)
Case 4
str=Request(str)
Case Else
str=str
End Select
str=""&Trim(str)
str=Replace(str,"'","''"
Select Case in_type
Case 1
str=Replace(str,CHR(32)," "
str=Replace(str,CHR(9)," "
str=Replace(str,CHR(10) & CHR(10),"</P><P> "
str=Replace(str,CHR(10),"<BR> "
str=Replace(str,CHR(13),""
Case 2
str=replace(str,">",">"
str=replace(str,"<","<"
str=Replace(str,CHR(32)," "
str=Replace(str,CHR(9)," "
str=Replace(str,CHR(34),"""
str=Replace(str,CHR(39),"'"
str=Replace(str,CHR(13),""
str=Replace(str,CHR(10)&CHR(10),"</P><P> "
str=Replace(str,CHR(10),"<BR> "
Case 3
str=replace(str,">",">"
str=replace(str,"<","<"
str=Replace(str," ",CHR(32))
str=Replace(str," ",CHR(9))
str=Replace(str,""",CHR(34))
str=Replace(str,"'",CHR(39))
str=Replace(str,"",CHR(13))
str=Replace(str,"</P><P> ",CHR(10)&CHR(10))
str=Replace(str,"<BR>",CHR(10))
Case else
str=str
End select
CheckStr=str
End Function
下面是调用方式:
UserName=checkstr(UserName,1,0)
表单路径,文本框名称全部正确.
请问我错在哪里了?