⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reg.asp

📁 本系统适用于选择题(单选和多选)的练习和考试.主要有七大模块:学习信息、经验交流、学生练习、学生考试、试卷管理、题库操作、身份 资料、成绩查询、系统帮助。超级管理员还可进行系统设置
💻 ASP
字号:
<!--#include file="open.asp" -->
<!--#include file="inc/md5.inc" -->
<%self_name="index.asp"
  back=request.querystring("back")%>
<%'学生用户注册
doing=request.querystring("doing")
if doing="reg" then
  user_id=trim(request.form("user_id"))
  student_class=request.form("student_class")
  pass1=trim(request.form("pass1"))
  pass2=trim(request.form("pass2"))
  pass3=trim(request.form("pass3"))
  q=trim(request.form("q"))
  a=trim(request.form("a"))
  student_sex=request.form("student_sex")
  str="select * from user_student where 学籍号='"&user_id&"'"    '1检查学籍是否正确
  set rs=conn.execute(str)
  if rs.eof then  
      msg="没有找到此学生,请检查学籍号是否正确"
  else
          '2检查初始密码是否正确
	  if rs("初始密码")<>pass1 then
	       msg="初始密码错误,请检查。如不知道请询问老师"
	  else
	           '3检查班级是否选错
		  if rs("班级")<>student_class then
		      msg="班级选选择错误,请重新选择班级"
		  else
               '4检查密码格式
			  if pass2<>pass3 then
			       msg="二输入的密码不一致,请重新输入"
			  else
			      if len(pass2)<6 then    '5
				       msg="密码不能小于6个字符,请重新输入密码"
				  else
				           '6检查提示问题及答案
					   if q="" or a="" then
					       msg="提示问题或答案不能为空,请重新输入"
					   else
					       if rs("密码")<>"" then
                                                   msg="此学生已经被注册,请检查信息是否正确"
					       else
						   password=ucase(md5(pass2))
						   str="update user_student set 性别='"&student_sex&"',密码='"&password&"',问题='"&q&"',答案='"&a&"' where 学籍号='"&user_id&"'"
						   conn.execute(str)
						   session("zzstudent")=true
				                   session("student_id")=user_id
				                   session("name")=rs("姓名")
								   session("student_bj")=rs("班级")
						   response.redirect(back)
					       end if
					   end if     '6
				  end if     '5
			  end if     '4
		  end if   '3
	  end if   '2
  end if   '1
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><!--#include file="inc/css.css" -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>学生用户注册</title>
</head>

<body topmargin="1">
<!--#include file="top.asp" -->
<!--#include file="menu.asp" -->
<table width="770" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#ff99cc" bgcolor="#edebdb">
  <tr>
    <td valign="top"> 
      <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td class="unnamed10"> </td>
        </tr>
      </table>
      <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td>
<form name="form1" method="post" action=reg.asp?back=<%=back%>&doing=reg>
              <table width="600" border="1" align="center" cellpadding="0" cellspacing="0">
                <tr> 
                  <td height="30" colspan="3" bgcolor="#999999" class="unnamed16"> 
                    <div align="center">学 生 注 册</div></td>
                </tr>
                <tr> 
                  <td width="30%" height="25" class="unnamed14"> 
                    <div align="right">学 
                      籍 号:</div></td>
                  <td width="40%">  
<input name="user_id" type="text" id="user_id" value=<%if user_id<>"" then response.write user_id else response.write id_disp end if%> size="20"></td>
                  <td width="30%">&nbsp;</td>
                </tr>
                <tr> 
                  <td width="30%" height="25" class="unnamed14"> 
                    <div align="right">初始密码:</div></td>
                  <td width="40%">  
                    <input name="pass1" type="password" id="pass1" size="20"></td>
                  <td width="30%">&nbsp;</td>
                </tr>
                <tr> 
                  <td width="30%" height="25" class="unnamed14"> 
                    <div align="right">班  级:</div></td>
                  <td width="40%">  
                    <select name="student_class" id="student_class">
<%str="select * from bj"
  set rs=conn.execute(str)
  do while not rs.eof%>
                      <option value="<%=rs("bj_name")%>"><%=rs("bj_name")%></option>
<%rs.movenext
  loop%>
                    </select></td>
                  <td width="30%">&nbsp;</td>
                </tr>
                <tr> 
                  <td width="30%" height="25" class="unnamed14"> 
                    <div align="right">性  别:</div></td>
                  <td width="40%">  
                    <select name="student_sex" id="student_sex">
                      <option value="男" selected>男</option>
                      <option value="女" <%if student_sex="女" then%>selected<%end if%>>女</option>
                    </select></td>
                  <td width="30%">&nbsp;</td>
                </tr>
                <tr> 
                  <td width="30%" height="25" class="unnamed14"> 
                    <div align="right">密  码:</div></td>
                  <td width="40%">  
                    <input name="pass2" type="password" id="pass2" size="20"></td>
                  <td width="30%" class="unnamed12"><font color="#FF0000">  不少于六个字符</font></td>
                </tr>
                <tr> 
                  <td width="30%" height="25" class="unnamed14"> 
                    <div align="right">重复密码:</div></td>
                  <td width="40%">  
                    <input name="pass3" type="password" id="pass3" size="20"></td>
                  <td width="30%">&nbsp;</td>
                </tr>
                <tr> 
                  <td width="30%" height="25" class="unnamed14"> 
                    <div align="right">提示问题:</div></td>
                  <td width="40%">  
                    <input name="q" type="text" id="q" value="<%=q%>"></td>
                  <td width="30%" rowspan="2" valign="middle" class="unnamed12H"><font color="#FF0000"> 忘记密码时使用</font></td>
                </tr>
                <tr> 
                  <td width="30%" height="25" class="unnamed14"> 
                    <div align="right">问题答案:</div></td>
                  <td width="40%">  
                    <input name="a" type="text" id="a" value="<%=a%>"></td>
                </tr>
                <tr> 
                  <td height="25" colspan="3" class="unnamed14"><div align="center">
                      <input type="submit" name="Submit" class="unnamed14" value=" 注 册 ">
                          
                      <input type="reset" name="Submit2" class="unnamed14" value=" 重 填 ">
                    </div></td>
                </tr>
              </table>
            </td></form>
        </tr>
      </table>
      <div align="center" class="unnamed14"> <font color="#FF0000">
        <%if msg<>"" then response.write msg end if%>
        </font></div></td>
  </tr>
</table>
<!--#include file="inc/bottom.asp" -->
<%conn.close%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -