一个郁闷的ASP有关问题,解急给分~
一个郁闷的ASP问题,解急给分~~~!<br />
郁闷的问题,,刚刚拿了个注册程序,就一个reg.asp文件,数据库的连接肯定是好的,然后里面出现了一些小的HTML标签问题吧,应该不影响的.关键是我用response.wirte(ID)可以显示出request( "ID ")包括空 " "(什么也不显示),但是问题就是居然我可以用出elseif的( " "用户名不能含有特殊字符 " ")却用不出( " "用户名不能为空! " ")的javascript,为什么呀,想破了都没知道为什么..
代码如下:
<%dim ID,PASSWORD
ID=trim(request.form( "ID "))
PASSWORD=trim(request.form( "PASSWORD "))
if ID = " " then
response.write " <script> alert( " "用户名不能为空! " ");
location.href= " "javascript:history.go(-1) " "; </script> "
elseif instr(ID, " ' ")> 0 or instr(ID, "; ")> 0 or instr(ID, ", ")> 0 or instr(ID, "` ")> 0 or instr(ID, "/ ")> 0 or instr(ID, "! ")> 0 or instr(ID, "char(34) ")> 0 or instr(ID, " ")> 0 or instr(ID, "* ")> 0 or instr(ID, "& ")> 0 or instr(ID, "@ ")> 0 then
response.write " <script> alert( " "用户名不能含有特殊字符! " ");
location.href= " "javascript:history.go(-1) " "; </script> "
response.end
end if