注册 登录
编程论坛 ASP技术论坛

非法字符判断

威龙嘉少 发布于 2007-11-23 09:40, 587 次点击
if Instr(username,".")<>0 and Instr(username,"@")<>0 and Instr(username,"<")<>0 and Instr(username,">")<>0 and Instr(username,"/")<>0 and Instr(username,"\")<>0 and Instr(username,"[url=file://\\]\\")<>0[/url] and Instr(username,"//")<>0 and Instr(username,"#")<>0 and Instr(username,"'")<>0 then
 response.write "<script language='javascript'>"
 response.write "alert('您输入的用户名中含有非法字符,请检查后重新输入!');"
 response.write "location.href='javascript:history.go(-1)';"      
 response.write "</script>"
 response.end
 end if
我这样写判断是否含有非法字符不对吗?
为什么含了非法字符也一样可以提交啊,好象没什么用?
请指教下啊!
1 回复
#2
madpbpl2007-11-23 10:39
把and改成or
1