<!--#include file="Inc/Conn.asp"-->
<!--#include file="Lock.asp"-->
<!--#include file="Inc/eshopcode.asp"-->
<!--#include file="Admin/MD5.asp"-->
<%If Request.QueryString("action")="" Then
Response.Redirect "Index.asp"
Else
If Request.Form("reg")=" 注 册 " Then
Dim server_v1
Dim server_v2
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER")) 
server_v2=Cstr(Request.ServerVariables("SERVER_NAME")) 
If mid(server_v1,8,len(server_v2))<>server_v2 then 
Response.Redirect "Index.asp"
End if

UserName=checkstr(Trim(Request.Form("UserName")))
Password=MD5(Trim(Request.Form("Password")))
Question=checkstr(Trim(Request.Form("Question")))
Answer=checkstr(Trim(Request.Form("Answer")))
sex=Request("sex")
email=checkstr(Trim(Request.Form("email")))
home=checkstr(Trim(Request.Form("home")))
Comane=checkstr(Trim(Request.Form("Comane")))
Zip=checkstr(Trim(Request.Form("Zip")))
Phone=checkstr(Trim(Request.Form("Phone")))
Fox=checkstr(Trim(Request.Form("Fox")))

Set ob=Conn.Execute("Select * From [User] Where [UserName]='"&UserName&"' ")
If Not(ob.Eof and ob.Bof) Then
        Response.write "<script language='javascript'>" & chr(13)
		Response.write "alert('用户名已存在!');" & Chr(13)
		Response.write "window.document.location.href='Register.asp';"&Chr(13)
		Response.write "</script>" & Chr(13)
        Response.End 
Else
Set rs = Server.CreateObject("ADODB.RecordSet")
sql = "select * From [User] Where (ID IS Null)"
rs.Open sql,conn,1,3
rs.AddNew
rs("UserName")=UserName
rs("PassWord")=Password
rs("Question")=Question
rs("Answer")=Answer
rs("Sex")=sex
rs("Email")=email
rs("Home")=home
rs("Compname")=Comane
rs("Zip")=Zip
rs("Phone")=Phone
rs("Fox")=Fox
rs.Update
rs.Close
Set rs=Nothing
        Response.write "<script language='javascript'>" & chr(13)
		Response.write "alert('注册成功!请返回登陆...');" & Chr(13)
		Response.write "window.document.location.href='Index.asp';"&Chr(13)
		Response.write "</script>" & Chr(13)
        Response.End 
End if
End if
End if
%>