<%
'function entercheck(str)
dim dist
dim i
dist=""
for i = 1 to len(str)
if mid(str,i,1)<>"'" and mid(str,i,1)<>"%" and ucase(mid(str,i,6))<>"SCRIPT" then
dist=dist+mid(str,i,1)
end if
next
dist=replace(dist,"<","<")
dist=replace(dist,">",">")
dist=replace(dist,"'","''")
entercheck=dist
end function
%>
用它对输入的数据进行过滤,另外也要对用户注册时候输入的口令进行编辑,代码如下:
<%
function mistake(preString)
Dim texts
Dim seed
Dim i,length
prestring = trim(preString)
length = len(preString)
seed = length
Randomize(length)
texts = ""
for i = 1 to length
seed = int(94*rnd(-asc(mid(preString,i,1))-seed*asc(right(prestring,1)))+32)
texts = texts & chr(seed) & chr(int(94*rnd(-seed)+32))
next
dim dist
dist=""
for i = 1 to len(texts)
if asc(mid(texts,i,1))>64 and asc(mid(texts,i,1))<123 then
dist=dist+mid(texts,i,1)
end if
next
mistake = dist
end function
%>