ASP表单验证的问题

来源:百度知道 编辑:UC知道 时间:2024/05/03 04:20:09
下面代码是验证表单 m 中EMAIL的正确性的,但不知道那错了,不管输入的正不正确到显示不正确,请高手指点那错了,要具体点

if inStr(m, "@") = 0 or inStr(m, ".") = 0 then
Response.Write "<script language='javascript'>alert(""您的EMAIL不正确!"");location.href=""gongqioufabu.asp"";</script>"
Response.end
end if
表单m里没有值,错在那了

错你的表单没有收到值喽,加我QQ说吧:198412173

--------------------------------------------
只是你的 m 没有接收到值

代码没有错,你改成这样试下,看提示里面m有没有值

if not (inStr(m, "@") > 0 and inStr(m, ".") > 0) then
Response.Write "<script language='javascript'>alert(""您的EMAIL不正确!""" & m & ");location.href=""gongqioufabu.asp"";</script>"
Response.end
end if

没看出有什么问题呀