Admin_Add.asp
上传用户:ahxunteng
上传日期:2022-05-16
资源大小:1606k
文件大小:1k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
VBScript
- <!--#include file="bsconfig.asp"-->
- <!--#include file="inc/md5.asp"-->
- <%
- password=replace(trim(Request("pwd1")),"'","")
- password=md5(password)
- set rs=server.createobject("adodb.recordset")
- sqltext="select * from Admin where UserName='" & request.form("UserName") & "'"'or RealName='" & request.form("realname") & "'and PassWord='" & password & "'"
- rs.open sqltext,conn,1,1
- '查找数据库,检查此管理员是否已经存在
- if rs.recordcount >= 1 then
- if rs("UserName")=request.form("UserName") then
- %>
- <script language='javascript'>alert ("此管理员帐号已经存在,请选用其它名称!"); location='Admin.asp';</script>
- <%
- response.end
- rs.close
- end if
- end if
- set rs=server.createobject("adodb.recordset")
- sqltext="select * from Admin"
- rs.open sqltext,conn,3,3
- '添加一个管理员帐号到数据库
- rs.addnew
- rs("UserName")=request.form("UserName")
- rs("RealName")=request.form("RealName")
- rs("PassWord")=password
- rs.update
- Response.Redirect "Admin.asp"
- %>
English
