<% if not theUser.admin then connclose() response.redirect ("index.asp") end if dim rs , exec %> <%=sitetitle%>
注册用户资料修改
<% main() connclose() sub main() dim backInput, homeInput dim userid userid=request("userid") backInput= "


" homeInput="


" if request.form="" then exec="select * from [user] where userid="& userid set rs=conn.execute(exec) %>
用 户 名: <%=rs("username")%>
新 密 码:
密码确认:
性  别: >男 >女 (已注册用户不用填)
头  像: "" then response.write rs("GBface") else response.write "face/m01.gif"%>" border=0 id="faceImg"> "" then response.write rs("GBface") else response.write "face/m01.gif"%>">
电子邮件: ">
  QQ  : ">
  ICQ  : ">
  MSN  : ">
主页地址: " class="input1">
管理权限:
<% else dim name, pass, npass1, npass2,male,face,email,qq,url,icq,msn,gbuserclass name=Encodestr(request.form("name")) npass1=Encodestr(request.form("npass1")) npass2=Encodestr(request.form("npass2")) 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")) gbuserclass=int(request.form("gbuserclass")) if npass1<>npass2 then response.write "发生错误

新密码和确认密码要相同!!!" response.write backInput exit sub end if exec="select * from [user] where userid="& userid set rs=server.createobject("adodb.recordset") rs.open exec,conn,1,3 if rs.eof then rsclose() response.write "发生错误

用户名不存在或密码错误!!!" response.write backInput exit sub end if name=rs("username") if npass1<>"" then pass=MD5(npass1) rs("userpassword")=pass end if if rs("sex")="1" and male="0" or rs("sex")<>"1" and male="1" then rs("sex")=male exec="update ly set male='"&male&"' where bl=1 and name='"&name&"'" conn.execute(exec) end if if rs("GBface")="" or rs("GBface")<>face then rs("GBface")=face exec="update ly set face='"&face&"' where bl=1 and name='"&name&"'" conn.execute(exec) end if if isNull(rs("useremail")) or rs("useremail")<>email then if email="" then email=null end if rs("useremail")=email exec="update ly set email='"&email&"' where bl=1 and name='"&name&"'" conn.execute(exec) end if if isNull(rs("oicq")) or rs("oicq")<>qq then if qq="" then qq=null end if rs("oicq")=qq exec="update ly set qq='"&qq&"' where bl=1 and name='"&name&"'" conn.execute(exec) end if if isNull(rs("homepage")) or rs("homepage")<>url then if url="" then url=null end if rs("homepage")=url exec="update ly set url='"&url&"' where bl=1 and name='"&name&"'" conn.execute(exec) end if if isNull(rs("icq")) or rs("icq")<>icq then if icq="" then icq=null end if rs("icq")=icq if isNull(icq) then exec="update ly set icq=null where bl=1 and name='"&name&"'" else exec="update ly set icq='"&icq&"' where bl=1 and name='"&name&"'" end if conn.execute(exec) end if if isNull(rs("msn")) or rs("msn")<>msn then if msn="" then msn=null end if rs("msn")=msn if isnull(msn) then exec="update ly set msn=null where bl=1 and name='"&name&"'" else exec="update ly set msn='"&msn&"' where bl=1 and name='"&name&"'" end if conn.execute(exec) end if if isNull(rs("gbuserclass")) or rs("gbuserclass")<>gbuserclass then rs("gbuserclass")=gbuserclass end if rs.update rsclose() response.write "修改成功!!!" response.write homeInput end if end sub %>