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

📄 insert_user.asp

📁 在线考试系统源码实现远程判卷
💻 ASP
字号:
<%if session("adminadmin")=false then response.redirect("index.asp") end if%>

<!--#include file="inc/open.asp" -->
<!--#include file="inc/md5.inc" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>增加管理员</title>
<!--#include file="inc/css.css" -->
</head>

<body>
<!--#include file="top.asp" -->
<!--#include file="menu.asp" -->
<%
  doing=request.querystring("doing")
  'response.write doing
  if doing="insert" then
     insert_user=request.form("insert_user")
	 insert_user=rtrim(ltrim(insert_user))
	 insert_name=request.form("insert_name")
	 insert_name=rtrim(ltrim(insert_name))
	 insert_pass=request.form("insert_pass")
	 insert_pass=rtrim(ltrim(insert_pass))
	 insert_pass1=request.form("insert_pass1")
	 insert_pass1=rtrim(ltrim(insert_pass1))
	 insert_class=request.form("insert_class")
	 if insert_user="" then 
	    msg="用户名不能为空" 
	  else
   	      if insert_name="" then
	          msg="真实姓名不能为空"
          else
              if insert_pass<>insert_pass1 or insert_pass="" then
                   msg="二次密码输入不一致或密码为空"
              else
			    str="select * from user_te where teacher_user='"&insert_user&"'"
				set rs=conn.execute(str)
				if not rs.eof then
                        msg="用户名“"&insert_user&"”已经存在,请换一个用户名"
				else
                   if insert_class="超级管理员" then jb=99 end if
                   if insert_class="教师" then jb=9 end if
                   insert_pass=ucase(md5(insert_pass))
                   str="insert into user_te(teacher_user,teacher_name,teacher_pass,teacher_class,teacher_jb) values('"&insert_user&"','"&insert_name&"','"&insert_pass&"','"&insert_class&"','"&jb&"')"
				   set rs=conn.execute(str)
				   msg="已经添加了一个用户"
	           end if
			   end if
		  end if
	 end if
  end if
%>
<table width="770" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="ffcc99" bgcolor="edebeb">
  <tr> 
    <td valign="top"> <form name="form1" method="post" action="insert_user.asp?doing=insert">
        <table width="500" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="unnamed6"> </a></td>
          </tr>
        </table>
        <table width="600" border="1" align="center" cellpadding="1" cellspacing="0">
          <tr> 
            <td height="40" colspan="2" bgcolor="#999999" class="unnamed14"><div align="center"><strong>添 加 管 理 员</strong></div></td>
          </tr>
          <tr class="unnamed12"> 
            <td width="50%" height="30"> <div align="center">用 户 名:</div></td>
            <td width="50%" height="30"> <div align="center"> 
                <input name="insert_user" type="text" id="insert_user" size="20" maxlength="15"></div></td>
          </tr>
          <tr class="unnamed12"> 
            <td width="50%" height="30"> <div align="center">真实姓名:</div></td>
            <td width="50%" height="30"> <div align="center"> 
                <input name="insert_name" type="text" id="insert_name" size="20" maxlength="15">
              </div></td>
          </tr>
          <tr class="unnamed12"> 
            <td width="50%" height="31"> <div align="center">用户密码:</div></td>
            <td width="50%" height="31"> <div align="center"> 
                <input name="insert_pass" type="password" id="insert_pass" size="20" maxlength="15"></div></td>
          </tr>
          <tr class="unnamed12"> 
            <td width="50%" height="30"> <div align="center">验证密码:</div></td>
			<td width="50%" height="30"> <div align="center">
                <input name="insert_pass1" type="password" id="insert_pass1" size="20" maxlength="15">
              </div></td>
          </tr>
          <tr class="unnamed12"> 
            <td width="50%" height="30"> <div align="center">用户类别:</div></td>
            <td width="50%" height="30"> <div align="center"> 
                <select name="insert_class" id="insert_class">
                  <option value="超级管理员">超级管理员</option>
                  <option value="教师" selected>教师</option>
                </select></div></td>
          </tr>
          <tr> 
            <td height="30" colspan="2"><div align="center"> 
                <INPUT class=unnamed5 onclick=javascript:history.go(-1) type=button value=" 返 回 ">
                   
                <input type="submit" name="Submit2" value=" 确 定 ">
                   
                <input type="reset" name="Submit3" value=" 重 填 ">
              </div></td>
          </tr>
        </table>
        <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr> 
            <td class="unnamed6"> </td>
          </tr>
          <tr> 
            <td><div align="center" class="unnamed14"> <font color="#FF0000"> 
                <%response.write msg%>
                </font> </div></td>
          </tr>
        </table>
        </form></td>
  </tr>
</table>
<!--#include file="inc/bottom.inc" -->
<%conn.close%>
</body>
</html>

⌨️ 快捷键说明

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