<!--#include file ="../md5/md5.asp"-->
<!--#include file="../inc/admin_conn.asp"-->
<%
   username=LCase(Request("username"))
   password=LCase(Request("newpin"))
   re_newpin=LCase(Request("re_newpin"))
   if password<>re_newpin then
   response.write"<script>alert('初始密码与确认密码不一致，不接受！');history.back();</Script>"
   response.end
   end if
   password=MD5(password)
   flag=Request("flag")

   Set rs=Server.CreateObject("Adodb.RecordSet")
   
   rs.Open "Select * from ylmv_admin where name='"&username&"'",conn

   if not rs.EOF then

   Response.Write "<font color=red><div align=center><br><br>该用户名已经存在</div></font>"
   Response.End   

   end if
   rs.close
   sql="select * from ylmv_admin"
   rs.open sql,conn,1,3
   rs.addnew
   rs("name")=username
   rs("pwd")=password
   rs("flag")=flag
   rs.update
   rs.Close
   set rs=Nothing
   
   conn.Close
   set conn=Nothing

   Response.Redirect "addadmin.asp"
%>