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

📄 add_admin_sav.asp

📁 oracle9i程序事例集
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!-- #include file="../common/conn.asp" -->
<!-- #include file="../common/status.html" -->
<!-- #include file="../common/md5.asp" --><html>
<head>
<title>添加管理员</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<% if session("admin_id")<>"admin" then %>
  您还没有登录或者您的权限不够,五秒钟后自动返回登录,如果您的浏览器没有自动返回,请<a href="../admin/login.html">点击登录</a>。
  <meta http-equiv="refresh" content="5;url=login.html">
<% else %>
</head>

<body background="../img/adminbg.gif">
<%
  dim id,pw,pw2,remark,rs,date1,sql

  set rs=server.createobject("adodb.recordset")

  if trim(request("id"))="" then
    errmsg=errmsg+"<br>"+"<li>管理员帐号不能为空"
    founderr=true
  else
    id=lcase(trim(request("id")))
  end if

  if trim(request("pw"))="" or trim(request("pw2"))="" then
    errmsg=errmsg+"<br>"+"<li>输入密码或确认密码不能为空"
    founderr=true
  else
    pw=md5(lcase(trim(request("pw"))))
    pw2=md5(lcase(trim(request("pw2"))))

  if pw <> pw2 then
    errmsg=errmsg+"<br>"+"<li>输入密码与确认密码不同"
    founderr=true
  else if len(trim(request("pw")))<6 then
    errmsg=errmsg+"<br>"+"<li>您输入的密码少于6位"
    founderr=true
  end if
  end if
  end if

  sql="select admin_id from scott.admin where admin_id='"&id&"'"
  rs.open sql,connstr
  if not rs.eof then
    errmsg=errmsg+"<br>"+"<li>管理员帐号已被别人注册"
    founderr=true
  end if
  rs.close

  remark=trim(request("remark"))
%>

<div align="center">
<center>
<table border="0" width="600" cellspacing="0" cellpadding="0">
<%  
  if founderr=false then
    date1=cstr(now)
    sql="select * from scott.admin"
    rs.open sql,connstr,3,3
    rs.addnew
    rs("admin_id")=id
    rs("admin_pw")=pw
    rs("admin_time")=date1
    rs("admin_remark")=remark
    rs.update
    rs.close
	set rs=nothing
%>

<tr> 
  <td height="20" align="center" bgcolor="#989DA5" colspan="3">管理员帐号添加成功</td>
<tr> 
  <td width="33%" height="20"><div align="right">管理员帐号:</div></td>
  <td width="67%" height="20" colspan="2"><div align="center"><%=id%></div></td>
</tr>
<tr> 
  <td width="33%" height="20"><div align="right">密码:</div></td>
  <td width="67%" height="20" colspan="2"><div align="center">请牢记您的密码!</div></td>
</tr>
<tr> 
  <td width="33%" height="20"><div align="right">创建时间:</div></td>
  <td width="67%" height="20" colspan="2"><div align="center"><%=date1%></div></td>
</tr>
<tr> 
  <td width="33%" height="20"><div align="right">备注:</div></td>
  <td width="67%" height="20" colspan="2"><div align="center"><%=remark%></div></td>
</tr>
<tr>
  <td height="20" align="center"><a href="update_pw.asp" target="_self">修改密码</a></td>
  <td align="center"><a href="add_admin.asp" target="_self">继续输入</a></td>
  <td align="center"><a href="index.asp" target="_self">返回首页</a></td>
</tr>

<%else%>
<meta http-equiv="refresh" content="3;url=javascript:history.go(-1)">
<tr> 
  <td width="600" height="20" align="center">管理员帐号信息有问题</td> 
</tr>
<tr> 
  <td><%=errmsg%></td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr><td align="center"><a href="javascript:history.go(-1)"><font size="-1">三秒钟后自动返回到上一页,如果您的浏览器没有返回,请单击此处</font></a></td></tr>
<%end if%>

</table>
</center>
</div>
</body>
<% end if %>
</html>

⌨️ 快捷键说明

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