editprofile.asp
来自「一个超市管理系统」· ASP 代码 · 共 661 行 · 第 1/2 页
ASP
661 行
<Script>
document.form.sign.value = unybbcode(document.form.sign.value);
document.form.sign.focus();
function unybbcode(temp) {
temp = temp.replace(/<br>/ig,"\n");
return (temp);
}
</Script>
<%
end sub
sub editProfileok
username=Request.Cookies("username")
realname=server.htmlencode(Request("realname"))
birthyear=server.htmlencode(Request("birthyear"))
birthmonth=server.htmlencode(Request("birthmonth"))
birthday=server.htmlencode(Request("birthday"))
userface=server.htmlencode(Request("userface"))
sex=server.htmlencode(Request("sex"))
country=server.htmlencode(Request("country"))
province=server.htmlencode(Request("province"))
city=server.htmlencode(Request("city"))
shengxiao=server.htmlencode(Request("shengxiao"))
blood=server.htmlencode(Request("blood"))
constellation=server.htmlencode(Request("constellation"))
character=server.htmlencode(Request("character"))
belief=server.htmlencode(Request("belief"))
college=server.htmlencode(Request("college"))
marital=server.htmlencode(Request("marital"))
education=server.htmlencode(Request("education"))
personal=server.htmlencode(Request("personal"))
occupation=server.htmlencode(Request("occupation"))
usermail=server.htmlencode(Request("usermail"))
userhome=server.htmlencode(Request("userhome"))
userqq=server.htmlencode(Request("userqq"))
icq=server.htmlencode(Request("icq"))
sign=server.htmlencode(Request("sign"))
sign=replace(sign,vbCrlf,"<br>")
sign=replace(sign,"\","\\")
if Len(constellation)>1 then
message=message&"<li>星座不能大于 1 个字符"
end if
if Len(character)>255 then
message=message&"<li>性格不能大于 255 个字符"
end if
if Len(personal)>255 then
message=message&"<li>个人简介不能大于 255 个字符"
end if
if Len(sign)>255 then
message=message&"<li>签名档不能大于 255 个字节"
end if
if isnumeric(userqq) = flase and userqq<>"" then
message=message&"<li>QQ号码请用数字填写"
end if
if isnumeric(icq) = flase and icq<>"" then
message=message&"<li>ICQ号码请用数字填写"
end if
if instr(usermail,"@")=0 then
message=message&"<li>您的电子邮件地址填写错误"
end if
if message<>"" then
error(""&message&"")
end if
sql="select * from user where username='"&HTMLEncode(username)&"'"
rs.Open sql,Conn,1,3
rs("realname")=realname
rs("birthyear")=birthyear
rs("birthmonth")=birthmonth
rs("birthday")=birthday
rs("userface")=userface
rs("sex")=sex
rs("country")=country
rs("province")=province
rs("city")=city
rs("shengxiao")=shengxiao
rs("blood")=blood
rs("constellation")=constellation
rs("character")=character
rs("belief")=belief
rs("college")=college
rs("marital")=marital
rs("education")=education
rs("personal")=personal
rs("sign")=sign
rs("occupation")=occupation
rs("usermail")=usermail
rs("userhome")=userhome
rs("userqq")=userqq
rs("icq")=icq
rs("landtime")=now
rs.update
rs.close
succtitle="修改资料成功"
message=message&"<li><a href=usercp.asp>控制面板首页</a>"
succeed(""&message&"<meta http-equiv=refresh content=3;url=usercp.asp>")
end sub
sub contact
sql="select * from user where username='"&HTMLEncode(Request.Cookies("username"))&"'"
rs.Open sql,Conn
%>
<table width=95% cellspacing=1 cellpadding=4 border=0 class=a2 align=center>
<form method="POST" name="form"action="EditProfile.asp">
<input type=hidden name="menu" value="contactok">
<tr>
<td height="20" align="center" colspan="2" valign="bottom" class=a1>
<b>编辑论坛选项</b></td>
</tr>
<tr>
<td height="2" align="right" width="45%" class=a4><b>YBB代码:</b></td>
<td height="2" align="left" width="55%" class=a4>
<input type=radio name="ybbcode" value="0" <%if Request.Cookies("ybbcode")="0" then%>checked<%end if%>>关闭
<input type=radio name="ybbcode" value="1" <%if Request.Cookies("ybbcode")="1" then%>checked<%end if%>>打开
<font color="#FF0000"> 默认:[打开]</font>
</td>
</tr>
<tr>
<td height="2" align="right" width="45%" class=a3><b>[IMG]代码:</b></td>
<td height="2" align="left" width="55%" class=a3>
<input type=radio name="ybbimg" value="0" <%if Request.Cookies("ybbimg")="0" then%>checked<%end if%>>关闭
<input type=radio name="ybbimg" value="1" <%if Request.Cookies("ybbimg")="1" then%>checked<%end if%>>打开
<font color="#FF0000"> 默认:[打开]</font>
</td>
</tr>
<tr>
<td class=a4 height="2" align="right" valign="middle" width="45%"><b>
[FLASH]代码:</b></td>
<td class=a4 height="2" align="left" valign="middle" width="55%">
<input type=radio name="ybbflash" value="0" <%if Request.Cookies("ybbflash")="0" then%>checked<%end if%>>关闭
<input type=radio name="ybbflash" value="1" <%if Request.Cookies("ybbflash")="1" then%>checked<%end if%>>打开
<font color="#FF0000"> 默认:[打开]</font>
</td>
</tr>
<tr class=a3>
<td height="2" align="right" width="45%"><b>表情字符:</b></td>
<td height="2" align="left" width="55%">
<input type=radio name="ybbbrow" value="0" <%if Request.Cookies("ybbbrow")="0" then%>checked<%end if%>>关闭
<input type=radio name="ybbbrow" value="1" <%if Request.Cookies("ybbbrow")="1" then%>checked<%end if%>>打开
<font color="#FF0000"> 默认:[打开]</font>
</td>
</tr>
</table>
<table width=95% cellspacing=1 cellpadding=4 border=0 class=a2 align=center>
<tr>
<td height="20" align="center" colspan="2" valign="bottom" class=a1>
<b>个人状态设定</b></td>
</tr>
<tr class=a4>
<td height="2" align="right" width="45%"> <b>在线状态:</b></td>
<td height="2" align="left" width="55%">
<input type=radio name="eremite" value="0" <%if Request.Cookies("eremite")="0" then%>checked<%end if%>>上线
<input type=radio name="eremite" value="1" <%if Request.Cookies("eremite")="1" then%>checked<%end if%>>隐身
<font color="#FF0000"> 默认:[上线]</font></td>
</tr>
<tr class=a3>
<td height="2" align="right" width="45%"><b>收到短讯时弹出提示框:</b></td>
<td height="2" align="left" width="55%">
<input type=radio name="newmessage" value="0" <%if Request.Cookies("newmessage")="0" then%>checked<%end if%>>关闭
<input type=radio name="newmessage" value="1" <%if Request.Cookies("newmessage")="1" then%>checked<%end if%>>打开
<font color="#FF0000"> 默认:[关闭]</font></td>
</tr>
<tr class=a3>
<td height="2" align="right" width="45%"><b>在帖子中显示用户头像:</b></td>
<td height="2" align="left" width="55%">
<input type=radio name="showface" value="0" <%if Request.Cookies("showface")="0" then%>checked<%end if%>>关闭
<input type=radio name="showface" value="1" <%if Request.Cookies("showface")="1" then%>checked<%end if%>>打开
<font color="#FF0000"> 默认:[打开]</font></td>
</tr>
</table>
<center><br>
<input type="submit" name="Submit" value=" 确 定 ">
</form>
<%
end sub
sub contactok
Response.Cookies("ybbcode")=Request("ybbcode")
Response.Cookies("ybbimg")=Request("ybbimg")
Response.Cookies("ybbflash")=Request("ybbflash")
Response.Cookies("ybbbrow")=Request("ybbbrow")
Response.Cookies("eremite")=Request("eremite")
Response.Cookies("newmessage")=Request("newmessage")
Response.Cookies("showface")=Request("showface")
Response.Cookies("ybbcode").Expires=date+365
Response.Cookies("ybbimg").Expires=date+365
Response.Cookies("ybbflash").Expires=date+365
Response.Cookies("ybbbrow").Expires=date+365
Response.Cookies("eremite").Expires=date+365
Response.Cookies("newmessage").Expires=date+365
Response.Cookies("showface").Expires=date+365
succtitle="更新设置成功"
message=message&"<li><a href=usercp.asp>控制面板首页</a>"
succeed(""&message&"<meta http-equiv=refresh content=3;url=usercp.asp>")
end sub
sub pass
sql="select * from user where username='"&HTMLEncode(Request.Cookies("username"))&"'"
rs.Open sql,Conn
%>
<table width=95% cellspacing=1 cellpadding=4 border=0 class=a2 align=center>
<form method="POST" name="form"action="EditProfile.asp">
<input type=hidden name="menu" value="passok">
<tr>
<td height="20" align="center" colspan="2" valign="bottom" class=a1>
<b>用户密码修改</b></td>
</tr>
<tr class=a4>
<td height="2" align="right" width="45%"><b> 原密码:</b></td>
<td height="2" align="left" width="55%">
<input type="password" name="olduserpass" size="40">
</td>
</tr>
<tr class=a3>
<td height="2" align="right" width="45%"><b> 新密码:</b><br>
如不更改密码此处请留空</td>
<td height="2" align="left" width="55%">
<input type="password" name="userpass" size="40" maxlength="16">
</td>
</tr>
<tr class=a4>
<td height="2" align="right" width="45%"><b>确认新密码:</b><br>
请与您的新密码保持一致</td>
<td height="2" align="left" valign="middle" width="55%">
<input type="password" name="userpass2" size="40" maxlength="16"></td>
</tr>
<tr class=a3>
<td height="1" align="right" width="45%"><b>密码提示问题:</b><br>
提示性问题,如:女朋友的生日?</td>
<td height="1" align="left" width="55%">
<input type="text" name="question" size="40" value="<%=rs("question")%>">
</td>
</tr>
<tr class=a4>
<td height="1" align="right" width="45%"><b>密码提示答案:</b><br>
问题的回答,如:1981/10/31</td>
<td height="1" align="left" width="55%" class=a4>
<input type="text" name="answer" size="40" value="<%=rs("answer")%>"></td>
</tr>
</table>
<center><br>
<input type="submit" name="Submit" value=" 确 定 ">
</form>
<%
end sub
sub passok
username=Request.Cookies("username")
userpass=Trim(Request("userpass"))
olduserpass=Trim(Request("olduserpass"))
userpass2=Trim(Request("userpass2"))
question=server.htmlencode(Request("question"))
answer=server.htmlencode(Request("answer"))
sql="select * from user where username='"&HTMLEncode(username)&"'"
rs.Open sql,Conn,1,3
if olduserpass<>rs("userpass") then
message=message&"<li>您的原密码错误"
end if
if userpass<>userpass2 then
message=message&"<li>您的新密码和确认新密码不同"
end if
if message<>"" then
error(""&message&"")
end if
if userpass="" then
userpass=olduserpass
end if
rs("userpass")=userpass
rs("question")=question
rs("answer")=answer
rs("landtime")=now
rs.update
rs.close
succtitle="修改资料成功"
message=message&"<li><a href=usercp.asp>控制面板首页</a>"
succeed(""&message&"<meta http-equiv=refresh content=3;url=usercp.asp>")
end sub
htmlend
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?