Register.asp
<html>
<head>
<SCRIPT language="JavaScript">
<!--
function Check()
{
window.open("regcheck.asp?username="+document.reg.username.value,"","width=200,height=100,left=270,top=270");
}
-->
</script>
<title>注册界面</title>
</head>
<body bgcolor="#E1E1E1">
<form action="AddUser.asp" method="post" name="reg">
<table height="170" width="950" background="../image/页头.jpg" align="center">
<tr><td></td></tr>
</table>
<table bgcolor="#CCCCCC" height="34" width="950" align="center">
<tr><td height="28"><h1 align="center">用 户 注 册 信 息</h1></td></tr>
</table>
<table bgcolor="#CCCCCC" height="20" width="950" align="center">
<tr><td width="435" height="14" align="right"><font color="#FF6666" size="-1">注意:有*标记的内容是必填项 </font></td>
<td width="503"></td>
</tr>
</table>
<table bgcolor="#CCCCCC" height="192" width="950" align="center">
<tr><td height="20"></td></tr>
<tr><td width="332" height="31" align="right">用户名:<font color="#FF6666">*</font></td>
<td width="606"> <input type="text" name="username" size="11" ><font size="-1" color="#FF6666">
<input type="button" onClick="Check()" value="检查用户名">
可以是中文,长度在11字节以内</font></td></tr>
<tr><td height="31" align="right">真 名:<font color="#FF6666">*</font></td>
<td><input type="text" name="name" size="18"></td></tr>
<tr><td height="31" align="right">年 龄:</td>
<td><input type="text" name="age" size="16"></td></tr>
<tr><td height="31" align="right">性 别:</td>
<td><select name="sex" size="1">
<option value="男">男</option>
<option value="女">女</option>
</select></td></tr>
<tr><td height="31" align="right">电 话:</td>
<td><input type="text" name="phone" size="20"></td></tr>
<tr><td height="31" align="right">电子邮箱:</td>
<td><input type="text" name="mail" size="30"></td></tr>
<tr><td height="31" align="right">密 码:<font color="#FF6666" size="-1">*</font><br><br ></td>
<td><input type="password" name="password" size="11" /><font color="#FF6666" size="-1">注意:密码不能超过11位</font></td></tr>
<tr><td height="31" align="right">确认密码:<font color="#FF6666" size="-1">*</font></td>
<td><input type="password" name="Verifypassword" size="11"><font color="#FF6666" size="-1">注意:密码不能超过11位</font></td></tr>
</table>
<table bgcolor="#CCCCCC" height="89" width="950" align="center">
<tr><td>
<hr align="center" size="1" width="300">
<p align="center"> <input type="submit" value="确定" size="50">
<input type="reset" value="重置" size="50">
<input type="button" value="退出" onClick="window.location='../index.asp'"></p>
</td></tr>
</table>
<table height="150" width="950" background="../image/页尾.jpg" align="center">
<tr><td></td></tr>
</table>
</form>
</body>
</html>
regcheck.asp
<%
dim conn,sql,rs,yhm,result
yhm=request("username")
Set conn = Server.CreateObject("ADODB.Connection")
sql="Provider = Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=E:\毕业设计\data\data.mdb"
conn.Open sql
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from login where username='"&username&"'",conn,1,3
if not(rs.bof and rs.eof) then
response.Write ("<p align=center><font color='#FF0000'>请另外选择用户名!</font></P>")
response.Write ("<p align=center><INPUT TYPE='BUTTON' value='关闭' onClick='window.close()'></P> ")
else
response.Write ("<p align=center><font color='#FF0000'>恭喜!你还可以注册该帐号!</font></P>")
response.Write ("<p align=center><INPUT TYPE='BUTTON' value='关闭' onClick='window.close()'></P> ")
end if
%>
为什么我输入用户名无论是什么都是请另外选择用户名!.请教?
[此贴子已经被作者于2006-4-3 14:41:56编辑过]