www.gusucode.com > 盘锦DJ舞曲网 商业版源码程序 > admin/Admin_Admin_Err.asp

    <!--#include file="../conn.Asp"-->
<!--#include file="md5.Asp"-->
<!--#include file="loginOK.asp"-->
<%
username=request.form("username")
password=request.form("password")
oskey=request.form("oskey")
if username="" or password="" then
	response.write("<script>alert('管理员名称和密码不能为空!');history.go(-1)</script>")
	Response.End 
end if

set rs=server.CreateObject("ADODB.RecordSet")
if request("act")="edit" and request.QueryString("id")<>"" then
	id=request("id")
	sql="select * from admin where id="& request.QueryString("id")
	rs.open sql,conn,3,2
	if not rs.eof then
		rs("type")=oskey
		rs("Username")=username
		Rs("password") = md5(Request.Form("password"))
		rs.update
	end if
	rs.close
elseif request("act")="add" then
	sql="select * from admin where username='"&username&"'"
	rs.open sql,conn,3,2
	if (rs.eof and rs.bof) then
		rs.addnew
		rs("type")=oskey
		rs("Username")=UserName
		Rs("password") = md5(Request.Form("password"))
		rs.update
	end if
	rs.close
end if
set rs=nothing
conn.close
set conn=nothing
response.redirect "Admin_Admin.Asp"
%>