if session("admin")="" then
response.redirect "admin.asp"
else
if session("flag")>1 then
response.write "您没有操作的权限"
response.end
end if
end if
dim username, password, right_class
dim rs, sql
username=LCase(Request("username"))
password=md5(LCase(Request("newpin")))
right_class=CInt(Request("right_class"))
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open "Select * from Admin where username='"&username&"'",conn
if not rs.EOF then
Response.Write "该用户名已经存在"
Response.End
end if
rs.close
sql="select * from admin"
rs.open sql,conn,1,3
rs.addnew
rs("username")=username
rs("password")=password
rs("flag")=right_class
rs.update
rs.Close
set rs=Nothing
conn.Close
set conn=Nothing
Response.Redirect "adminuser.asp"
%>