<% dim action : action=getform("action","get") if action = "reg" then addUser() elseif action = "editpass" then editUser() else echoContent() end if Sub editPass dim LoginName,userPass,reuserPass LoginName=trim(rCookie("loginName")) userPass=getForm("userPass","post") reuserPass=getForm("reuserPass","post") if userPass<>reuserPass then alertMsgAndGo "Two input password is not the same","-1" 'die "update {prefix}User set [Password]='"&md5(userPass,16)&"' where LoginName='"&LoginName&"'" conn.Exec "update {prefix}User set [Password]='"&md5(userPass,16)&"' where LoginName='"&LoginName&"'","exe" alertMsgAndGo "Password update successful","editPass.asp" End Sub Sub editUser dim LoginName,userPass,reuserPass,Email,Mobile,Address,PostCode,Gender,QQ,TrueName,Phone LoginName=trim(rCookie("loginName")) userPass=getForm("userPass","post") reuserPass=getForm("reuserPass","post") Email=filterPara(getForm("Email","post")) Mobile=filterPara(getForm("Mobile","post")) Address=filterPara(getForm("Address","post")) PostCode=filterPara(getForm("PostCode","post")) Gender=filterPara(getForm("Gender","post")) QQ=filterPara(getForm("QQ","post")) TrueName=filterPara(getForm("TrueName","post")) Phone=filterPara(getForm("Phone","post")) if userPass<>reuserPass then alertMsgAndGo "Two input password is not the same","-1" dim passStr if not isnul(userPass) then passStr="[Password]='"&md5(userPass,16)&"'," Conn.Exec"update {prefix}User set "&passStr&" Email='"&Email&"',QQ='"&QQ&"',Mobile='"&Mobile&"',Address='"&Address&"',PostCode='"&PostCode&"',Gender="&Gender&",Phone='"&Phone&"',TrueName='"&TrueName&"' where LoginName='"&LoginName&"'","exe" alertMsgAndGo "Update successful","editPass.asp" End Sub Sub echoContent() dim templateobj,templatePath : set templateobj = new TemplateClass templatePath="/Templates/en/htmlen/reg.html" 'die templatePath if not CheckTemplateFile(templatePath) then echo "reg.html"&err_16 with templateObj .content=loadFile(templatePath) .parseHtml() .indexpath .parseCommon echo .content end with set templateobj =nothing : terminateAllObjects End Sub Sub addUser 'dim UserID,GroupID,LanguageID,SceneID,LoginName,Password,PswQuestion,PswAnswer,UserStatus,RegTime,RegIP,LastLoginIP,LastLoginTime,LoginCount,TrueName,Gender,Birthday,Country,Province,City,Address,PostCode,Phone,Mobile,Email,QQ,MSN,Permissions,AdminDesc Dim LoginName,Password,verifyPass,Email,Mobile,Address,PostCode,Gender,QQ,UserStatus,RegTime,RegIP,LastLoginIP,LastLoginTime,Birthday,Exp1,Exp2,Exp3,GroupID,TrueName,Phone if getForm("code","post")<>Session("Code") then alertMsgAndGo "Verification is error","-1" LoginName=filterPara(getForm("LoginName","post")) Password=filterPara(getForm("userPass","post")) verifyPass=filterPara(getForm("verifyPass","post")) Email=filterPara(getForm("Email","post")) Mobile=filterPara(getForm("Mobile","post")) Address=filterPara(getForm("Address","post")) PostCode=filterPara(getForm("PostCode","post")) Gender=1 Gender=filterPara(getForm("Gender","post")) QQ=filterPara(getForm("QQ","post")) Phone=filterPara(getForm("Phone","post")) TrueName=filterPara(getForm("TrueName","post")) UserStatus=1 RegTime=now() RegIP=getip() GroupID=3 if isnul(LoginName) then alertMsgAndGo "Username not null","-1" if Conn.Exec("select count(*) from {prefix}User where LoginName='"&LoginName&"'","r1")(0) >0 then alertMsgAndGo "The user name has been registered","-1" if isnul(Password) then alertMsgAndGo "Password not null","-1" if isnul(verifyPass) then alertMsgAndGo "Password Confirmation not null","-1" if Password<>verifyPass then alertMsgAndGo "Two input password is not the same","-1" Password=md5(Password,16) Conn.Exec"insert into {prefix}User(LoginName,[Password],Email,Mobile,Address,PostCode,Gender,QQ,UserStatus,RegIP,RegTime,GroupID,TrueName,Phone) values('"&LoginName&"','"&Password&"','"&Email&"','"&Mobile&"','"&Address&"','"&PostCode&"',"&Gender&",'"&QQ&"',"&UserStatus&",'"&RegIP&"','"&RegTime&"',"&GroupID&",'"&TrueName&"','"&Phone&"')","exe" alertMsgAndGo "Registration successful£¡",sitePath&setting.languagepath&"member_en/login.asp" End Sub %>