<% dim rs , exec %> <%=sitetitle%>
用户注册
<% main() connclose() sub main() dim backInput, homeInput backInput= "


" homeInput="


" if request.form="" then %>
用 户 名:
密   码:
性  别: 女 (已注册用户不用填)
头  像: " border=0 id="faceImg">
电子邮件:
  QQ  :
  ICQ  :
  MSN  :
主页地址:
<% else dim name, pass, male,face,email,qq,url,icq,msn name=Encodestr(request.form("name")) pass=Encodestr(request.form("pass")) male=Encodestr(request.form("male")) face=Encodestr(request.form("face")) email=Encodestr(request.form("email")) qq=Encodestr(request.form("qq")) url=Encodestr(request.form("url")) icq=Encodestr(request.form("icq")) msn=Encodestr(request.form("msn")) if name="" or pass="" then response.write "发生错误

请输入用户名和密码!!!" response.write backInput exit sub end if 'if not validEmail(email) then ' response.write "发生错误

请输入正确的email地址!!!" ' response.write backInput ' exit sub 'end if pass=MD5(pass) 'if isLikeMasterName(name) then ' response.write "发生错误

请不要使用与版主名相似的用户!!!" ' response.write backInput ' exit sub 'end if exec="select * from [user] where username='"&name&"' " set rs=server.createobject("adodb.recordset") rs.open exec,conn,1,3 if not (rs.eof and rs.bof) then rsclose() response.write "发生错误

该用户名已被注册,请选择其它用户名!!!" response.write backInput exit sub end if rs.Addnew rs("username")=name rs("userpassword")=pass rs("sex")=male rs("GBface")=face if email<>"" then rs("useremail")=email end if if qq<>"" then rs("oicq")=qq end if if icq<>"" then rs("icq")=icq end if if msn<>"" then rs("msn")=msn end if if url<>"" then rs("homepage")=url end if rs("GBpostNum")=0 rs("GBprivateNum")=0 rs("addDate")=now rs.update rsclose() response.write "注册成功!!!" response.write homeInput if cookiePath<>"" then response.cookies("gbook").Path=cookiePath end if response.cookies("gbook")("username")=vbescape(name) response.cookies("gbook")("password")=pass end if end sub %>