<%
if Request.ServerVariables("REQUEST_METHOD")="POST" then
msg=""
if request("username")="" then
msg=msg+"请输入用户名!<br>"
end if
if request("passwd")="" then
msg=msg+"请输入密码!<br>"
end if
if request("confirm")="" then
msg=msg+"请输入确认密码!<br>"
end if
if request("passwd")<>request("confirm") then
msg=msg+"密码和确认密码不一致!<br>"
end if
if msg<>"" then
showerror(msg)
end if
sql="select * from user where username='"&Request.form("username")&"'"
rs.open sql,adocon,3,2
if not rs.eof then
showerror("该用户名已经存在,请重新选用另一个试试!")
else
rs.addnew
rs("username")=request.form("username")
rs("passwd")=request.form("passwd")
rs("purview")=request.form("purview")
rs.update
ShowSuccess("数据已经成功保存!")
end if
rs.close
else
%>