%
dim aqn, rndaq, rsq
aqn = 0
rndaq = 0
set rs = server.createobject("adodb.recordset")
sql = "select [question] from [" & dbmunber & "aqcode]"
rs.cursorlocation = 3
rs.open sql, conn, 1, 1
aqn = rs.recordcount
if rs.recordcount > 0 then
randomize
rndaq = int(rs.recordcount * rnd())
rs.move rndaq
rsq = rs(0)
end if
rs.close
set rs = nothing
dim webparameters, t
act = saferequest(request("act"), 0)
t = saferequest(request("t"), 0)
set rs = server.createobject("adodb.recordset")
sql = "select [parameters] from [" & dbmunber & "config]"
rs.cursorlocation = 3
rs.open sql, conn, 1, 1
webparameters = split(rs(0), ",")
rs.close
set rs = nothing
if act = "reg" then
dim username, password, password1, xingming, xingbie, shengfen, dizhi, dianhua, xinxiang, qq, tjr, dyzm, dquestion
username = saferequest(request.form("username"), 0)
password = saferequest(request.form("password"), 0)
password1 = saferequest(request.form("password1"), 0)
xingming = saferequest(request.form("xingming"), 0)
xingbie = saferequest(request.form("xingbie"), 0)
shengfen = saferequest(request.form("shengfen"), 0)
dizhi = saferequest(request.form("dizhi"), 0)
dianhua = saferequest(request.form("dianhua"), 0)
xinxiang = saferequest(request.form("xinxiang"), 0)
dyzm = saferequest(request.form("yzm"), 0)
dquestion = saferequest(request.form("question"), 0)
qq = saferequest(request.form("qq"), 1)
tjr = saferequest(request.form("tjr"), 0)
if len(username) < 3 or len(username) > 20 then call msgbox("登录帐号长度为3-20位!", "reg.asp")
if checkstring(username, "([%]|[?]|[=]|[/]|[\\]|[*]|[ ]|[+]|[<]|[>]|[{]|[}]|[&]|[']$)") = true then call msgbox("登录帐号中不允许使用非法字符。", "reg.asp")
if len(password) < 1 then call msgbox("请填写登录密码!", "reg.asp")
if password <> password1 then call msgbox("两次输入的密码不一致,请重新输入。", "-1")
if len(xingming) < 1 then call msgbox("请填写真实姓名!", "reg.asp")
if len(xingbie) < 1 then call msgbox("请选择性别!", "reg.asp")
if len(shengfen) < 1 then call msgbox("请选择所在省份!", "reg.asp")
if len(dianhua) < 1 then call msgbox("请添写联系电话!", "reg.asp")
if dianhua <> "" then
if checkstring(dianhua, "(^[0-9]{3,4}\-[0-9]{7,8}$)|(^[0-9]{3,4}[0-9]{7,8}$)|(^[1-9]{1,1}[0-9]{6,7}$)") = false and checkstring(dianhua, "(^(13|15|18)[0-9]{9}$)") = false then call msgbox("电话的格式不正确。", "reg.asp")
if (left(dianhua, 5) = "12590" or left(dianhua, 3) = "168") then call msgbox("不允许使用特别服务号码。", "-1")
end if
if xinxiang <> "" and checkstring(xinxiang, "^([a-zA-Z0-9_-])+@([\.a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,6}){1,2})$") = false then call msgbox("电子信箱格式不正确。", "reg.asp")
if qq <> "" and checkstring(qq, "(^[1-9]{1,1}[0-9]{4,9}$)") = false then call msgbox("腾讯QQ的格式不正确。", "-1")
if qq <> "" and qq = "10000" then call msgbox("不允许使用系统服务号码。", "reg.asp")
if aqn > 0 then
if dquestion = "" or dyzm = "" then call msgbox("非法的提交操作。", "index.asp")
set rs = server.createobject("adodb.recordset")
sql = "select [answer] from [" & dbmunber & "aqcode] where [question] = '" & dquestion & "'"
rs.cursorlocation = 3
rs.open sql, conn, 1, 1
if rs.recordcount = 0 then call msgbox("非法的提交操作。", "index.asp")
if md5(dyzm) <> md5(rs(0)) then call msgbox("验证答案输入不正确。", "-1")
end if
set rs = server.createobject("adodb.recordset")
sql = "select [username], [password], [name], [sex], [province], [address], [tel], [email], [qq], [time], [ip], [lock], [type], [lv], [pay], [loginnumber], [exp], [logintime], [loginip], [tjren] from [" & dbmunber & "member] where [username] = '" & username & "'"
rs.cursorlocation = 3
rs.open sql, conn, 1, 3
if rs.recordcount = 0 then
rs.addnew
rs(0) = username
rs(1) = md5(password)
rs(2) = xingming
rs(3) = xingbie
rs(4) = shengfen
rs(5) = dizhi
rs(6) = dianhua
rs(7) = xinxiang
rs(8) = qq
rs(9) = now()
rs(10) = myip
if webparameters(0) = 1 then
rs(11) = true
else
rs(11) = false
end if
rs(12) = "普通用户"
rs(13) = 0
rs(14) = 0
rs(15) = 0
rs(16) = 0
rs(17) = now()
rs(18) = myip
rs(19) = tjr
rs.update
if xinxiang <> "" then
dim temp_t, temp_b
temp_t = "用户注册信息"
temp_b = "尊敬的用户:恭喜您!注册成功!
登录帐号:" & username & "
登录密码:" & password & "
" & ename & "免费发布各类供求信息!
网址:" & eurl & "
电话:" & eservicetel & "
QQ:" & eserviceqq & " (点击交谈)
"
call smtpmail(xinxiang, temp_t, temp_b)
end if
call msgbox("恭喜,注册成功!", "userlogin.asp")
else
call msgbox("提示\n此帐号已被注册,请换别的吧!", "reg.asp")
end if
rs.close
set rs = nothing
end if
%>