<!--#include file="conn1.asp"-->



<%
 if request.QueryString("action")="save" then
 
 
 set rs=server.CreateObject("adodb.recordset")
rs.open "select * from member where UserEmail='"&trim(request("UserEmail"))&"' or UserName='"&trim(request("username"))&"'",conn,1,1
if rs.recordcount>0 then
	Response.Write "<script language=javascript>window.alert('您输入的用户名或e-mail地址已存在，请返回重新输入！');window.history.go(-1);</script>"
	response.End
end if


set rs=server.CreateObject("adodb.recordset")
rs.open "select * from member",conn,1,3
rs.addnew
rs("username")=trim(request("username"))
rs("leixing")=int(request("leixing"))
rs("Password")=trim(request("UserPassword"))
rs("UserEmail")=trim(request("UserEmail"))

rs("sex")=trim(request("sex"))
rs("contact")=trim(request("contact"))
rs("shouji")=trim(request("shouji"))
rs("qicq")=trim(request("qicq"))
rs("dizhi")=trim(request("dizhi"))
rs("adddate")=now()
rs.update
rs.close
set rs=nothing
'response.Redirect"login.asp?action=注册成功"
response.write "<script language=javascript>alert('注册成功！');window.location.href='login.asp';</script>"
response.End
end if
%>