sql,conn,1,3 rs("username")=request.Form("username") rs("password")=request.Form("password") rs("mail")=request.Form("mail") rs("sex")=request.Form("sex") rs("qq")=request.Form("qq") rs("add")=request.Form("add") rs("personalinfo")=request.Form("personalinfo") rs.update set rs=nothing response.Write("修改完成!") end if %> 4, (reg.asp 新用户注册页面)
用户注册
<% =request.QueryString("msg") %> 5, (addnewdata.asp 新用户注册数据处理文件)
<% ac=request.QueryString("ac") msg="注册错误信息" if request.Form("username")="" then msg=msg&;amp;"
"&;amp;"用户名不能为空" end if if strcomp(cstr(request.Form("password")),cstr(request.Form("password2")))<>0 then msg=msg&;amp;"
"&;amp;"两次密码输入不同" end if if len(request.Form("password"))<6 then msg=msg&;amp;"
"&;amp;"密码太简单" end if if strcomp(msg,"注册错误信息")>0 then response.Redirect("reg.asp?msg="&;amp;msg) end if if ac="adduser" then set rsc=server.createobject("adodb.recordset") sql="select * from info where username='"&;amp;request.Form("username")&;amp;"'" rsc.open sql,conn,1,1 ck=rsc("username")
6
set rsc=nothing if ck<>"" then msg=msg&;amp;"
"&;amp;"用户名被人注册" response.Redirect("reg.asp?msg="&;amp;msg) end if dsql="select * from info where id is null" set rs=server.createobject("adodb.recordset") rs.open dsql,conn,1,3 rs.addnew rs("username")=request.Form("username") rs("password")=request.