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

📄 insert_user.asp

📁 办公系统的公文处理
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="md5.inc"-->
<%if session("adminadminadmin")<>true then response.redirect("list.asp") end if%>
<%'增加操作
   doing=request.querystring("doing")
if doing="insert" then
   user=trim(request.form("user"))
   user_name=trim(request.form("user_name"))
   pass1=trim(request.form("pass1"))
   pass2=trim(request.form("pass2"))
   no=trim(request.form("no"))
   bumeng=request.form("bumeng")
   user_class=request.form("user_class")
    if user="" or user_name="" or pass1="" or pass2="" or no="" then    '1判断有否空内容
	    msg="用户名、单位、密码、序号不能为空"
	else
	    if pass1<>pass2 then   '2二次密码是否一致
		    msg="二次输入的密码不一致"
		else
		    str="select * from user where 用户名='"&user&"'"
			set rs=conn.execute(str)
			if not rs.eof then   '3如果用户名已存在
			    msg="该用户名已存在,请换一个"
			else
			    pass=ucase(md5(pass1))
				str="insert into user (用户类别,用户名,密码,单位,部门,序号) values ('"&user_class&"','"&user&"','"&pass&"','"&user_name&"','"&bumeng&"','"&no&"')"
				conn.execute(str)
				user=""
				user_name=""
			end if      '3		
		end if     '2
	end if   '1
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>增加用户</title>
<!--#include file="css.css"-->
</head>

<body topmargin="1">
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr><td><!--#include file="top.asp"--></td></tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="124" height="347" valign="top" bgcolor="#95a8d0"> 
      <table width="140" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><!--#include file="left.asp"--></td>
        </tr>
    </table></td>
    <td width="560" align="center" valign="top" bgcolor="#95a8d0">
<table width="550" border="0" cellpadding="0" cellspacing="0" class="unnamed12">
        <tr>
          <td height="20">&nbsp;</td>
        </tr>
      </table>

      <table width="550" height="20" border="0" align="center" cellspacing="0" class="unnamed12">
        <tr> 
          <td><form name="form1" method="post" action="insert_user.asp?doing=insert">
              <table width="550" border="0" align="center" cellpadding="0" cellspacing="1">
                <tr bgcolor="#FF9966" class="unnamed14"> 
                  <td height="30" align="center" > 项   目</td>
                  <td height="30" > <div align="center">内      容</div></td>
                </tr>
                <tr bgcolor="#ffcc99" class="unnamed12"> 
                  <td  height="30"> <div align="center">用 户 名:</div></td>
                  <td  height="30">  
                  <input name="user" type="text" id="user" value="<%=user%>" size="24"></td>
                
                </tr>
                <tr bgcolor="#FFFFFF" class="unnamed12"> 
                  <td height="30"><div align="center">用户单位:</div></td>
                  <td height="30">  
                  <input name="user_name" type="text" id="user_name" value="<%=user_name%>" size="24"></td>
                
                </tr>
                <tr bgcolor="#ffcc99" class="unnamed12"> 
                  <td height="30"> <div align="center">用户密码:</div></td>
                  <td height="30">  
                  <input name="pass1" type="password" id="pass1" size="25"></td>
                 
                </tr>
                <tr bgcolor="#FFFFFF" class="unnamed12"> 
                  <td height="30"> <div align="center">验证密码:</div></td>
                  <td height="30">  
                  <input name="pass2" type="password" id="pass2" size="25"></td>
                 
                </tr>
                <tr bgcolor="#ffcc99" class="unnamed12"> 
                  <td height="30"> <div align="center">序  号:</div></td>
                  <td height="30">  
                  <input name="no" type="text" id="no" size="24"></td>
                 
                </tr>
                <tr bgcolor="#FFFFFF" class="unnamed12"> 
                  <td height="30"><div align="center">用户类别:</div></td>
                  <td height="30">  
                    <select name="user_class" id="user_class">
                      <option value="超级管理员">超级管理员</option>
                      <option value="栏目管理员">栏目管理员</option>
                      <option value="一般用户" selected>一般用户</option>
                  </select></td>
                 
                </tr>
                <tr bgcolor="#ffcc99" class="unnamed12"> 
                  <td height="30"> <div align="center">部  门:</div></td>
                  <td height="30">  
                    <select name="bumeng" size="1" id="bumeng">
                      <%str="select * from bumeng"
  set rs=conn.execute(str)
  do while not rs.eof%>
                      <option value=<%=rs("部门")%>><%=rs("部门")%></option>
                      <%rs.movenext
    loop%>
                  </select></td>
               
                </tr>
                <tr valign="middle" bgcolor="#FF9966" class="unnamed12"> 
                  <td height="30" colspan="3"><div align="center"> 
                      <input type="submit" name="Submit" value=" 增 加 ">
                         
                      <input type="reset" name="Submit2" value=" 重 填 ">
                  </div></td>
                </tr>
              </table>
            </form></td>
        </tr>
      </table>
      <div align="center" class="unnamed14"><font color="#FF0000"><%if msg<>"" then response.write msg end if%></font></div></td>
  </tr>
</table>

<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="bottom.asp"--></td>
  </tr>
</table>
<%conn.close%>
</body>
</html>

⌨️ 快捷键说明

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