response.Charset="gb2312"
dim username,root,title,url,password,repassword,question,answer,truename,email,telephoto,address,sn
username=vdns.getstr("username")
root=vdns.getstr("domainroot")
title=vdns.getstr("title")
url=vdns.getstr("url")
password=vdns.getstr("password")
repassword=vdns.getstr("repassword")
question=vdns.getstr("question")
answer=vdns.getstr("answer")
truename=vdns.getstr("truename")
email=vdns.getstr("email")
telephoto=vdns.getstr("telephoto")
address=vdns.getstr("address")
sn=vdns.getstr("sn")
select case request("action")
case "checksn"
if lcase(sn)=lcase(session("getcode")) then
vdns.echo 1
else
vdns.echo 0
end if
case "checkreg"
if username="" or root="" then
vdns.echo "false|请填写要注册的域名"
else
if vdns.chkdomain(username,0) and vdns.isusername(username) then
vdns.echo vdns.checkuser(username,root)
else
vdns.echo "false|你所要注册的域名格式不正确"
end if
end if
case "reg"
if username="" or root="" or title="" or url="" or password="" or repassword="" or question="" or answer="" or truename="" or email="" or telephoto="" or address="" then
vdns.echo "false|请不要留空"
else
on error resume next
if reglimit<>0 then
vdns.opendata
dim rs,vback
set rs=conn.execute("select regtime from vdns where regip='"&vdns.getip&"' order by id desc")
if not rs.eof then
if datediff("n",rs(0),now())<=reglimit then vdns.echo "false|该IP已注册过域名了!":vdns.die
end if
rs.close
end if
if lcase(sn)<>lcase(session("getcode")) then vdns.echo "false|验证码不正确":vdns.die
session("getcode")=""
if vdns.chkdomain(username,0)=false or vdns.isusername(username)=false then vdns.echo "false|用户名格式不正确":vdns.die
if vdns.filter(title)=false or vdns.filter(url)=false then vdns.echo "false|你所提交的信息含有非法成份":vdns.die
if password<>repassword then vdns.echo "false|两次输入的密码不一致":vdns.die
if len(password)<6 then vdns.echo "false|密码不能小于6位":vdns.die
vback=vdns.userreg(username,root,title,url,password,question,answer,email,truename,telephoto,address)
if reglimit<>0 then
conn.execute("insert into vdns (regip,regtime) values ('"&vdns.getip&"',#"&now()&"#)")
conn.execute("delete * from vdns where cint(now()-regtime)>=1")
conn.close
vdns.closedata
end if
if err then
vdns.echo "false|系统错误: " & Err.Description
else
vdns.echo vback
end if
end if
end select
set vdns=nothing
%>