📄 register.asp
字号:
<!-- #include file="conn/conn.asp" -->
<html>
<script language="javascript">
function check(){
if(document.f_zc.id.value=="")
{//判断用户是否输入用户名
alert("请输入用户名!")
document.f_zc.id.focus()
return
}
if(document.f_zc.name.value=="")
{//判断用户是否输入姓名
alert("请输入姓名!")
document.f_zc.name.focus()
return
}
if(document.f_zc.pwd1.value=="")
{//判断用户是否输入密码
alert("请输入密码!")
document.f_zc.pwd1.focus()
return
}
if(document.f_zc.pwd2.value=="")
{//判断用户是否输入密码
alert("请输入确认密码!")
document.f_zc.pwd2.focus()
return
}
if(document.f_zc.pwd1.value!==document.f_zc.pwd2.value)
{//判断用户是否输入密码
alert("请确认两次输入的密码相同!")
document.f_zc.pwd1.value=""
document.f_zc.pwd2.value=""
document.f_zc.pwd1.focus()
return
}
if(document.f_zc.pro.value=="")
{//判断用户是否输入密码
alert("请输入专业!")
document.f_zc.pro.focus()
return
}
//提交表单 插入注册信息
document.f_zc.submit()
}
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户注册</title>
</head>
<body bgcolor="#0099FF">
<p><H1 align="center">红豆在线考试系统</H1></p>
<form method="POST" name="f_zc" action="adduser.asp">
<table align="center" width="55%">
<tr><td><p><font color="red">带*的为必填项(请如实填写资料)</font></p></td></tr>
<tr><td><p>用 户 名:<input type="text" name="id" size="20">*</p></td></tr>
<tr><td><p>密 码:<input type="password" name="pwd1" size="20" maxlength="20">*(不能大于20位,区分大小写)</p></td></tr>
<tr><td><p>确认密码:<input type="password" name="pwd2" size="20" maxlength="20">*</p></td></tr>
<tr><td><p>姓 名:<input type="text" name="name" size="20">*</p></td></tr>
<tr><td><p>班 级:<input type="text" name="class" size="10"></p></td></tr>
<tr><td><p>学 号:<input type="text" name="cid" size="20">(如T2830812)</p></td></tr>
<tr><td><p>密码问题:<input type="text" name="question" size="40">(如:您的生日)</p></td></tr>
<tr><td><p>问题答案:<input type="text" name="answer" size="40">(如:19800101)</p></td></tr>
<tr><td><p>性 别:<select size="1" name="sex">
<option value="男">男</option>
<option value="女">女</option>
</select></p></td></tr>
<tr><td><p>所学专业:<%set rstype=createobject("adodb.recordset")
sql="select * from profession order by id"
rstype.Open sql,conn,1,3%>
<select name="pro">
<option value="">请选择</option>
<%do while not rstype.EOF%>
<option value="<%=rstype("id")%>"><%=rstype("name")%></option>
<%
rstype.MoveNext
loop
set rstype=nothing
%>
</select>
</p></td></tr>
</table>
<p align="center">
<input type="button" value="注册" name="ok" onclick="check()">
<input type="reset" value="重写" name="cancel">
<input type="button" value="关闭" name="close" onclick="window.close()">
</p>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -