📄 u_modifymy.asp
字号:
<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!--#include file="inc/chkinput.asp"-->
<%
'=========================================================
' File: u_modifymy.asp
' Date: 2006-04-06
' Script Written by Leibo
'=========================================================
' Copyright (C) 2002,2008 Mathren.com. All rights reserved.
' Web: http://www.hrbyydz.com
' Email: qa_90@hotmail.com
'=========================================================
response.buffer=true
stats="修改基本资料"
if not founduser then
Errmsg=Errmsg+"<br>"+"<li>您还没有登陆,请登陆后进行修改。"
founderr=true
end if
call head()
if founderr then
errmsg=errmsg+"<br>"+"<li>您没有<a href=login.asp target=_blank>登录</a>。"
call head_var("","")
call txl_error()
else
call head_var("个人菜单","u_index.asp")
if request("action")="update" then
call update()
if founderr then
call txl_error()
else
sucmsg="<li>更改资料成功!"
call txl_suc()
end if
else
call userinfo()
if founderr then call txl_error()
end if
end if
call foot()
sub userinfo()
set rs=server.createobject("adodb.recordset")
sql="Select * from [User] where userid="&userid
rs.open sql,conn,1,1
if rs.eof and rs.bof then
errmsg=errmsg+"<br>"+"<li>该用户名不存在。"
founderr=true
exit sub
end if
%>
<table width="<%=txl_body(0)%>" cellpadding="0" cellspacing="0" align="center" style="border:1px <%=txl_body(9)%> solid; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 1px;">
<tr>
<td bgcolor=<%=txl_body(10)%> align="center" valign="top"><br>
<table cellpaddin=3 cellspacing=1 class=tableborder1 width=<%=txl_body(19)%> align=center>
<tr>
<th width=14% height=25 id=tabletitlelink><a href=u_index.asp>个人菜单首页</a></th>
<th width=14% id=tabletitlelink><a href=u_modifymy.asp>基本资料修改</a></th>
<th width=14% id=tabletitlelink><a href=u_modifypsw.asp>用户密码修改</a></th>
<th width=14% id=tabletitlelink><a href=u_modifyadd.asp>联系资料修改</a></th>
<th width=14% id=tabletitlelink><a href=u_myskin.asp>选择界面风格</a></th>
<th width=14% id=tabletitlelink><a href=usersms.asp>我的短信管理</a></th>
<th width=14% id=tabletitlelink><a href=d_index.asp>我的日记管理</a></th>
</tr>
</table>
<br>
<table cellpadding=5 cellspacing=1 border=0 class=tableborder1 width=<%=txl_body(19)%> align=center>
<form action="U_modifymy.asp?action=update&username=<%=htmlencode(membername)%>" method=POST name="theForm">
<tr>
<th height=25 colspan=2>基本资料修改</td>
</tr>
<tr>
<td width="40%" class=tablebody1><b>登 录 名:</b><br>此项不可修改,需要修改请与<a href=mailto:<%=txl_info(5)%>><u>管理员</u></a>联系!</td>
<td width="60%" class=tablebody1> <b><%=rs("username")%> / <%=rs("realname")%></b></td>
</tr>
<tr>
<td width="40%" class=tablebody1><B>性 别:</B><BR>请选择您的性别</td>
<td width="60%" class=tablebody1><input type="radio" value="0"<%if rs("sex")=0 then%> checked <%end if%>name="Sex">酷哥 <input type="radio" name="Sex"<%if rs("sex")=1 then%> checked <%end if%> value="1">靓妹</td></td>
</tr>
<tr>
<td width="40%" class=tablebody1><B>生 日</B><BR>如不想填写,请全部留空</td>
<td width="60%" class=tablebody1>
<select name=birthyear>
<option value=""></option>
<%for i=1901 to 2000%>
<option value="<%=i%>" <%if not isnull(rs("birthday")) and isdate(rs("birthday")) then%><%if cint(year(rs("birthday")))=cint(i) then response.write "selected"%><%end if%>><%=i%></option>
<%next%>
</select>
年
<select name=birthmonth>
<option value=""></option>
<%for i=1 to 12%>
<option value="<%=i%>" <%if not isnull(rs("birthday")) and isdate(rs("birthday")) then%><%if cint(month(rs("birthday")))=cint(i) then response.write "selected"%><%end if%>><%=i%></option>
<%next%>
</select>
月
<select name=birthday>
<option value=""></option>
<%for i=1 to 31%>
<option value="<%=i%>" <%if not isnull(rs("birthday")) and isdate(rs("birthday")) then%><%if cint(day(rs("birthday")))=cint(i) then response.write "selected"%><%end if%>><%=i%></option>
<%next%>
</select>
日</font>
</td>
</tr>
<TR>
<TD width=40% class=tablebody1><B>头 像</B>:<BR>您可以选择一个个性图片,当你发表留言或帖子时将显示在您的名字下方。</TD>
<TD width=60% class=tablebody1>
<select name=face size=1 onChange="document.images['face'].src=options[selectedIndex].value;" style="BACKGROUND-COLOR: #99CCFF; BORDER-BOTTOM: 1px double; BORDER-LEFT: 1px double; BORDER-RIGHT: 1px double; BORDER-TOP: 1px double; COLOR: #000000">
<%
dim userregface
for i=0 to txl_userfaceNum
userregface=txl_info(10)&txl_userface(i)
if trim(lcase(rs("userface"))) = trim(lcase(userregface)) then
%>
<option value="<%=txl_info(10)&txl_userface(i)%>" selected><%=txl_userface(i)%></option>
<% else %>
<option value='<%=txl_info(10)&txl_userface(i)%>'><%=txl_userface(i)%></option>
<%
end if
next
%>
</select>
<img id=face src="<%=rs("userface")%>"></td>
</TR>
<tr>
<td width="40%" class=tablebody1><b>个人照片:</b><br>如果您有照片在网上,请输入网页地址。此项可选</td>
<td width="60%" class=tablebody1> <INPUT type=text size=35 name="userphoto" value="<%=rs("userphoto")%>"> 如:http://www.163.com/photo.jpg</td>
</tr>
<tr>
<td valign=top width="40%" class=tablebody1><B>签 名</B>:<BR>不能超过 250 个字符 <br> 文字将出现在您发表的文章的结尾处。</td>
<td width="60%" class=tablebody1> <textarea name="Signature" rows=5 cols=60 wrap=PHYSICAL>
<%if rs("sign")<>"" then%>
<%
dim signtrue
signtrue=replace(rs("sign"),"<BR>",chr(13))
signtrue=replace(signtrue," "," ")
%><%=signtrue%><%end if%></textarea>
</td>
</tr>
<tr>
<td colspan="2" width="100%" class=tablebody2 align="center"><input type=Submit value="更 新" name="Submit"> <input type="reset" name="Submit2" value="清 除"></td>
</tr>
</form>
</table><br>
</td>
</tr>
</table>
<%
rs.close
set rs=nothing
end sub
sub update()
dim sex,userface,birthday
if request("sex")="" then
errmsg=errmsg+"<br>"+"<li>请选择您的性别。"
founderr=true
elseif request("sex")=0 or request("sex")=1 then
sex=request("sex")
else
errmsg=errmsg+"<br>"+"<li>您输入的字符非法。"
founderr=true
end if
if request("face")="" then
errmsg=errmsg+"<br>"+"<li>请选择您的个性头像。"
founderr=true
else
userface=request("face")
end if
if strLength(request("Signature"))>250 then
errmsg=errmsg+"<br>"+"<li>签名只能在250个字符以内。"
founderr=true
end if
if request.Form("birthyear")="" or request.form("birthmonth")="" or request.form("birthday")="" then
birthday=""
else
birthday=trim(Request.Form("birthyear"))&"-"&trim(Request.Form("birthmonth"))&"-"&trim(Request.Form("birthday"))
if not isdate(birthday) then birthday=""
end if
set rs=server.createobject("adodb.recordset")
sql="Select * from [User] where userid="&userid
rs.open sql,conn,1,3
if rs.eof and rs.bof then
errmsg=errmsg+"<br>"+"<li>该用户名不存在。"
founderr=true
else
rs("userface")=replace(userface,"'","")
rs("sex")=sex
rs("userphoto")=request("userphoto")
rs("sign")=trim(request("Signature"))
if birthday<>"" then
rs("birthday")=birthday
end if
rs.Update
end if
rs.close
set rs=nothing
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -