| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 529 人关注过本帖
标题:注册提交错误后,为什么还能注册成功?
只看楼主 加入收藏
castell
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2006-11-7
收藏
 问题点数:0 回复次数:3 
注册提交错误后,为什么还能注册成功?

<!--#include file="head.asp"-->
<HTML>

<HEAD>
<TITLE>会员注册</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<link rel="stylesheet" href="css/pub20040831.css">

</HEAD>
<script for="user" event="onclick" language="vbscript">
msgbox"不要在这里输入你的用户名,请先查找你的用户名是否已经被使用,请返回前一页!"
</script>
<body background="images/bgground.jpg"text="#000000">

<%
dim check_code
randomize
check_code=int(9000*Rnd()+1000)
%>
<script language="JavaScript">
function checkdata() {
if
(memberform.pwd.value.length < 4 || memberform.pwd.value.length > 16)
{
memberform.pwd.focus();
memberform.pwd.select();
alert("请您输入密码(4至16位) !");
}


else if(memberform.pass2.value.length==0)
{
memberform.pass2.focus();
memberform.pass2.select();
alert("请您确认您输入的密码 !");
}

else if(memberform.pwd.value!=memberform.pass2.value)
{
memberform.pass2.focus();
memberform.pass2.select();
alert("确认密码不一样 !");
}

else if(memberform.question.value.length==0)
{
memberform.question.focus();
memberform.question.select();
alert("密码提示问题不能为空 !");
}

else if(memberform.answer.value.length==0)
{
memberform.answer.focus();
memberform.answer.select();
alert("密码提示答案不能为空 !");
}

else if(memberform.email.value.length==0)
{
alert("邮箱地址不能为空 !")
memberform.email.focus();
memberform.email.select();
}

else if( memberform.email.value.length<6 || memberform.email.value.length>36 || !validateEmail() )
{
alert("\请您输入正确的邮箱地址 !");
memberform.email.focus();
memberform.email.select();
}


<!-- else if( memberform.state.value == "" ) -->
<!-- { -->
<!-- alert("\请选择地区 !"); -->
<!-- } -->
<!-- else if(memberform.verify.value=="" || memberform.verify.value.length < 6 || memberform.verify.value.length > 6)-->
<!-- {-->
<!-- alert("验证码出错 !"); -->
<!-- }-->
else if( memberform.check_code.value !== memberform.check_code2.value)
{
alert("\验证码错误 !");
}


function validateEmail(){
var re=/^[\w-]+(\.*[\w-]+)*@([0-9a-z]+[0-9a-z-]*[0-9a-z]+\.)+[a-z]{2,3}$/i;
if(re.test(memberform.email.value))
return false;
else
return true;
}
function checkerr(string)
{
var i=0;
for (i=0; i<string.length; i++)
{
if((string.charAt(i) < '0' || string.charAt(i) > '9') && (string.charAt(i) < 'a' || string.charAt(i) > 'z') && (string.charAt(i) < 'A' || string.charAt(i) > 'Z') && (string.charAt(i)!='_'))
{
return 1;
}
}
return 0;//pass
}

</script>

<br><BR>
<div align="center" ><font color="#98d058" size="7">会员注册</font></div>
<table width="660" border="0" align="center" cellpadding="0" cellspacing="1">
<form name=memberform action="regok.asp" method="post" onSubmit="return checkdata()">
<input type="hidden" name="t" size="40" value="minfo">
<input type="hidden" name="f" size="40" value="adding">
<input type="hidden" name="v" size="40" value="">
<tr>
<td width="641" height="30" bgcolor="#DFF19D">
<table width="440" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#DFF19D">
<tr>
<td width="120" height="20">
<div align="right">你的用户名:</div></td>
<td><span class="12"> </span>
<table width="105%" border="0" cellspacing="0" cellpadding="0">
<%
dim yourname
yourname=request.QueryString("username1")
%>
<tr>
<td width="137"><span class="12">
<input tabindex=1 name="user" value="<%=yourname%>" type="hidden" size="20" height="15">
&nbsp;&nbsp;【<%=yourname%>】
</span></td>
<td width="7"><span class="12"> </span></td>
<td width="196"><span class="12">
</span></td>
</tr>
</table></td>
</tr>
</table> </td>
</tr>
<tr>
<td bgcolor="#DFF19D"><table width="440" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="120" height="20">
<div align="right"><font color="#FF0000">*</font> 密码:</div></td>
<td><span class="12">
<input tabindex=2 type="password" name="pwd" size=20 value="" style="font-size: 12px; border: 1 solid #29A1E6; background-color:#ffffff" height="15">
</span></td>
</tr>
<tr>
<td height="20"> </td>
<td>密码可使用长度为6-14的任何字符,并区分英文字母大小写</td>
</tr>
<tr height="5">
<td></td>
<td></td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#DFF19D"><table width="440" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="120" height="20">
<div align="right"><font color="#FF0000">*</font> 确认密码:</div></td>
<td><span class="12">
<input tabindex=3 type="password" name="pass2" size=20 value="" style="font-size: 12px; border: 1 solid #29A1E6; background-color:#ffffff" height="15">
</span></td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#DFF19D"><table width="440" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="120" height="20">
<div align="right"><font color="#FF0000">*</font> 提示问题:</div></td>
<td><span class="12">
<input tabindex=4 name="question" type="text" value="" size=35 maxlength=80 style="font-size: 12px; border: 1 solid #29A1E6; background-color:#ffffff" height="15">
</span></td>
</tr>
<tr height="8">
<td></td>
<td></td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#DFF19D"><table width="440" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="120" height="20">
<div align="right"><font color="#FF0000">*</font> 提示答案:</div></td>
<td><span class="12">
<input tabindex=5 name=answer type=text value="" size=35 height="15" maxlength=80 style="font-size: 12px; border: 1 solid #29A1E6; background-color:#ffffff">
</span></td>
</tr>
<tr>
<td height="20"> </td>
<td>&nbsp;</td>
</tr>
</table></td>
</tr>
<tr>
<td height="20" bgcolor="#DFF19D">
<table width="440" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="120" height="20"><div align="right"> <font color="#FF0000">*</font> E-mail:</div></td>
<td><span class="12">
<input tabindex=6 name=email type=text height="15" size=35 value="" style="font-size: 12px; border: 1 solid #29A1E6; background-color:#ffffff">
</span></td>
</tr>
<tr>
<td height="20"></td>
<td>注册成功后,方便用户联系</td>
</tr>
</table></td>
</tr>
<tr>
<td height="16" bgcolor="#DFF19D"><table width="440" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="120" height="20">
<div align="right"><font color="#FF0000">*</font> QQ: </div></td>
<td><span class="12">
<input tabindex=7 name="QQ" height="15">
</span></td>
</tr>
<tr>
<td width="120" height="20">
<div align="right"><font color="#FF0000">*</font> 性别: </div></td>
<td>
<select name="sex">
<option value="man">帅哥</option>
<option value="female">美女</option>
</select></td>
</tr>
<tr>
<td width="120" height="20">
<div align="right"> 联系地址: </div></td>
<td><span class="12">
<input tabindex=9 name="address" size=35 value="" height="15">
</span></td>
</tr>
<tr>
<td width="120" height="20">
<div align="right"> 邮政编码: </div></td>
<td><span class="12">
<input tabindex=10 name="postcode" size=10 value="" height="15">
</span></td>
</tr>
<tr>
<td width="120" height="20">
<div align="right"> 联系电话: </div></td>
<td><span class="12">
<input tabindex=11 size=16 name="telphone" height="15" >
</span></td>
</tr>
<tr>
<td width="120" height="20">
<div align="right"> 出生日期: </div></td>
<td><span class="12">
<input tabindex=12 name="birth" size=10 value="1981-1-1" height="15" >
</span></td>
</tr>
<tr>
<td width="120" height="20">
<div align="right"> 主页: </div></td>
<td><span class="12">
<input tabindex=13 name="homepage" size=18 value="" height="15">
</span></td>
</tr>
<tr>
<td height="20">
<div align="right">所在地区:</div></td>
<td>
<input type="hidden" name="state" value="">
<input type="hidden" name="city" value="">
<script language=JavaScript src="sheng_city.js"></script></td>
</tr>
<tr>
<td height="20" align="right"><font color="#FF0000">*</font> 验证码:</td>
<td><span class="12">
<input name="check_code" id="check_code" tabindex=13 value="" size=9>&nbsp;&nbsp;<font color=red><%=check_code%></font> <input type="hidden" name="check_code2" value=<%=check_code%>>
</span> </td>
</tr>
</table></td>
</tr>
<tr>
<td height="50" bgcolor="#DFF19D"><div align="center">
<input tabindex=16 type="submit" name="submit1" value="确认提交">
&nbsp; &nbsp; &nbsp;
<input type="reset" name="submit2" value="全部重写">
</div></td>
</tr>
</form>
</table>
<p>&nbsp;</p>
<!--#include file="footer.asp"-->
</BODY>
</HTML>
在提交注册后,当密码或邮箱等有不符合规则的输入后,比如我密码输入了3位数,在提交注册后,会显示密码不能少于6位
,但是还是能注册成功的,不知道是不是这段代码有问题?哪位大侠帮我看看?万分感谢了

搜索更多相关主题的帖子: 注册 
2007-04-27 20:44
castell
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2006-11-7
收藏
得分:0 
帮帮我,谢谢拉
2007-04-27 20:45
castell
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2006-11-7
收藏
得分:0 
帮帮我,谢谢拉
2007-04-27 20:45
阳光白雪
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:39
帖 子:2220
专家分:0
注 册:2005-11-18
收藏
得分:0 
memberform.pwd.focus();
memberform.pwd.select();
alert("请您输入密码(4至16位) !");
return false; //如果出错就返回假值,每提示出错的地方都加上这句


专注于WEB前端交互平台开发:[url=http://blog./]blog.[/url](富客户端技术(RIA)交流平台)
2007-04-28 08:34
快速回复:注册提交错误后,为什么还能注册成功?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022212 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved