首页 新闻 论坛 群组 Blog 文档 下载 读书 Tag 网摘 搜索 .NET Java 游戏 视频 人才 外包 培训 数据库 书店 程序员
中国软件网
欢迎您:游客 | 登录 注册 帮助
  • 用户名重复但验证不出来,还是会提交完成! [已结贴,结贴人:only9966]
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    • only9966
    • 等级:
    • 可用分等级:
    • 总技术专家分:
    • 总技术专家分排名:
    • 揭帖率:
    发表于:2008-05-18 18:14:14 楼主
    请给看看下面哪里有问题?如果选项没填或2次密码不同都会验证出来,就是用户名重复验证不出来,还会正常提交上去!
    <%
    exec="select * from user where uname='"&uname&"'" 
    Set rs = Server.CreateObject("ADODB.Recordset") 
    rs.open exec,conn,1,1 
    if not (rs.eof and rs.bof) then
    response.write" <SCRIPT language=JavaScript>alert('用户名重复,请重新选择一个用户名!');"
    response.write"../index </SCRIPT>"
    end if
    if psd2 <>psd then
    Response.Write(" <script>      alert('两次密码不相同!');javascript:history.go(-1);  </script> ")
    end if

    if uname=""or tel=""or un="" then 'or psd=""or un=""or xb=""or sr=""or tel=""or zy="" 
        Response.Write(" <script> alert('请填写完整!'); javascript:history.go(-1); </script> ") 
    else 
        exec="insert into user(uname,psd,un,tel)values('"+uname+"','"+psd+"','"+un+"','"+tel+"')" 
    conn.execute exec
    Response.Write(" <script> alert('已提交成功!'); this.location.href='index.asp';  </script> ")
    end if
    %>
    20  修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    • songpengasp
    • 等级:
    • 可用分等级:
    • 总技术专家分:
    • 总技术专家分排名:
    发表于:2008-05-18 18:26:391楼 得分:20
    HTML code
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <% if psd2 <>psd then Response.Write(" <script> alert('两次密码不相同!'); history.go(-1); </script> ") response.End() end if if uname=""or tel=""or un="" then 'or psd=""or un=""or xb=""or sr=""or tel=""or zy="" Response.Write(" <script> alert('请填写完整!'); history.go(-1); </script> ") response.End() end if exec="select * from user where uname='"&uname&"'" Set rs = Server.CreateObject("ADODB.Recordset") rs.open exec,conn,1,1 if not (rs.eof and rs.bof) then response.write" <SCRIPT language=JavaScript>alert('用户名重复,请重新选择一个用户名!');" response.write" history.go(-1);</SCRIPT>" response.End() end if exec="insert into user(uname,psd,un,tel)values('"+uname+"','"+psd+"','"+un+"','"+tel+"')" conn.execute exec Response.Write(" <script> alert('已提交成功!'); this.location.href='index.asp'; </script> ") %> <body> </body> </html>
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    • songpengasp
    • 等级:
    • 可用分等级:
    • 总技术专家分:
    • 总技术专家分排名:
    发表于:2008-05-18 18:28:412楼 得分:0
    HTML code
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <% if psd2 <>psd then Response.Write(" <script> alert('两次密码不相同!'); history.go(-1); </script> ") else if uname=""or tel=""or un="" then 'or psd=""or un=""or xb=""or sr=""or tel=""or zy="" Response.Write(" <script> alert('请填写完整!'); history.go(-1); </script> ") else exec="select * from user where uname='"&uname&"'" Set rs = Server.CreateObject("ADODB.Recordset") rs.open exec,conn,1,1 if not (rs.eof and rs.bof) then response.write" <SCRIPT language=JavaScript>alert('用户名重复,请重新选择一个用户名!');" response.write" history.go(-1);</SCRIPT>" else exec="insert into user(uname,psd,un,tel)values('"+uname+"','"+psd+"','"+un+"','"+tel+"')" conn.execute exec Response.Write(" <script> alert('已提交成功!'); this.location.href='index.asp'; </script> ") end if end if end if %> <body> </body> </html>
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    • only9966
    • 等级:
    • 可用分等级:
    • 总技术专家分:
    • 总技术专家分排名:
    发表于:2008-05-18 18:35:343楼 得分:0
    谢谢,已解决!!3Q
    修改 删除 举报 引用 回复

    网站简介广告服务网站地图帮助联系方式诚聘英才English 问题报告
    北京创新乐知广告有限公司 版权所有 京 ICP 证 070598 号
    世纪乐知(北京)网络技术有限公司 提供技术支持
    Copyright © 2000-2008, CSDN.NET, All Rights Reserved