<!--#include file="include/nowshop.asp"-->
<!--#include file="md5.asp"-->
<%
'call aspsql()
UserId=request.form("UserId")
User_Password=request.form("pw1")
userpassword=md5(user_password)
UserMail=request.form("UserMail")
Username=request.form("Username")
UserQQ=request.form("UserQQ")
UserICQ=request.form("UserICQ")
UserMSN=request.form("UserMSN")
Sex=request.form("Sex")
Birthday=request.form("Birthday")
CompPhone=request.form("CompPhone")
HomePhone=request.form("HomePhone")
Country=request.form("Country")
Province=request.form("Province")
City=request.form("City")
Address=request.form("Address")
ZipCode=request.form("ZipCode")
Memo=request.form("Memo")
tjr=request.form("tjr")


jptxt="ゴ|ガ|ギ|グ|ゲ|ザ|ジ|ズ|ヅ|デ|ド|ポ|ベ|プ|ビ|パ|ヴ|ボ|ペ|ブ|ピ|バ|ヂ|ダ|ゾ|ゼ"
jptext=split(jptxt,"|")
for jp=0 to ubound(jptext)
userid=replace(userid,jptext(jp),"")
Username=replace(Username,jptext(jp),"")
next
'过滤日文字符及其它常见的非法文字
if request("UserId")<>UserId or request("Username")<>Username then
	response.write "<script language='javascript'>"
	response.write "alert('本系统不允许使用日文字符，请检查后重新输入！');"
	response.write "location.href='javascript:history.go(-1)';"							
	response.write "</script>"	
	response.end
end if

if instr(lcase(userid),"admin")>0 or instr(userid,"管理员")>0  or instr(userid,"游客")>0 then
	response.write "<script language='javascript'>"
	response.write "alert('警告：不允许使用此类用户名，请检查后重新输入！');"
	response.write "location.href='javascript:history.go(-1)';"							
	response.write "</script>"	
	response.end
end if

if buyoktxtcheck(userid)<>userId then
	response.write "<script language='javascript'>"
	response.write "alert('您输入的用户名中含有非法字符，请检查后重新输入！');"
	response.write "location.href='javascript:history.go(-1)';"							
	response.write "</script>"	
	response.end
end if
set rs = conn.execute ("SELECT * FROM buser where UserId= '" & UserId & "'")
if not (rs.Bof or rs.eof) then
set rs=nothing

	response.write "<script language='javascript'>"
	response.write "alert('该帐号已经有人使用，请选择其它用户名!');"
	response.write "location.href='javascript:history.go(-1)';"							
	response.write "</script>"	
	response.end
else
call buyok_check_path()
sqlinfo = "select * from buser"
set rs=Server.Createobject("ADODB.RecordSet")
rs.Open sqlinfo,conn,1,3
rs.AddNew
rs("UserId")=UserId
rs("UserPassword")=UserPassword
rs("Username")=Username
rs("UserQQ")=UserQQ
rs("UserICQ")=UserICQ
rs("UserMSN")=UserMSN
rs("Sex")=Sex
rs("Birthday")=Birthday
rs("HomePhone")=HomePhone
rs("CompPhone")=CompPhone
rs("UserMail")=UserMail
rs("Country")=Country
rs("Province")=Province
rs("City")=City
rs("Address")=Address
rs("ZipCode")=ZipCode
rs("Memo")=Memo
rs("tjr")=tjr
rs("IP")=Request.serverVariables("REMOTE_ADDR")
rs.Update
rs.close
set rs = nothing

response.cookies("buyok")("userid")=userid

'登陆完成


response.write "<script language='javascript'>"
response.write "alert('恭喜，注册成功。单击“确定”登陆本站。');"
response.write "</script>"
response.write "<meta http-equiv=refresh content='0;URL=user_center.asp'>"
end if
%>
