u_modifymy.asp
上传用户:comthink
上传日期:2021-05-06
资源大小:1280k
文件大小:7k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <!--#include file="conn.asp"-->
  2. <!-- #include file="inc/const.asp" -->
  3. <!--#include file="inc/chkinput.asp"-->
  4. <%
  5. '=========================================================
  6. ' File: u_modifymy.asp
  7. ' Version:5.0
  8. ' Date: 2003-8-1
  9. ' Script Written by Leibo
  10. '=========================================================
  11. ' Copyright (C) 2003,2004 Mathren.com. All rights reserved.
  12. ' Web: http://www.mathren.com
  13. ' Email: webmaster@mathren.com
  14. '=========================================================
  15. response.buffer=true
  16. stats="修改基本资料"
  17. if not founduser then
  18. Errmsg=Errmsg+"<br>"+"<li>您还没有登陆,请登陆后进行修改。"
  19. founderr=true
  20. end if
  21. call head()
  22. if founderr then
  23.    errmsg=errmsg+"<br>"+"<li>您没有<a href=login.asp target=_blank>登录</a>。"
  24. call head_var("","")
  25. call  txl_error()
  26. else
  27. call head_var("个人菜单","u_index.asp")
  28. if request("action")="update" then
  29. call update()
  30. if founderr then
  31. call  txl_error()
  32. else
  33. sucmsg="<li>更改资料成功!"
  34. call txl_suc()
  35. end if
  36. else
  37. call userinfo()
  38. if founderr then call txl_error()
  39. end if
  40. end if
  41. call foot()
  42. sub userinfo()
  43. set rs=server.createobject("adodb.recordset")
  44. sql="Select * from [User] where userid="&userid
  45. rs.open sql,conn,1,1
  46. if rs.eof and rs.bof then
  47. errmsg=errmsg+"<br>"+"<li>该用户名不存在。"
  48. founderr=true
  49. exit sub
  50. end if
  51. %>
  52. <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;">  
  53. <tr> 
  54. <td bgcolor=<%=txl_body(10)%> align="center" valign="top"><br>
  55. <table cellpaddin=3 cellspacing=1 class=tableborder1 width=<%=txl_body(19)%> align=center>
  56. <tr>
  57. <th width=14% height=25 id=tabletitlelink><a href=u_index.asp>个人菜单首页</a></th>
  58. <th width=14% id=tabletitlelink><a href=u_modifymy.asp>基本资料修改</a></th>
  59. <th width=14% id=tabletitlelink><a href=u_modifypsw.asp>用户密码修改</a></th>
  60. <th width=14% id=tabletitlelink><a href=u_modifyadd.asp>联系资料修改</a></th>
  61. <th width=14% id=tabletitlelink><a href=u_myskin.asp>选择界面风格</a></th>
  62. <th width=14% id=tabletitlelink><a href=usersms.asp>我的短信管理</a></th>
  63. <th width=14% id=tabletitlelink><a href=d_index.asp>我的日记管理</a></th>
  64. </tr>
  65. </table>
  66. <br>
  67. <table cellpadding=5 cellspacing=1 border=0 class=tableborder1 width=<%=txl_body(19)%> align=center>
  68. <form action="U_modifymy.asp?action=update&username=<%=htmlencode(membername)%>" method=POST name="theForm">
  69. <tr>
  70. <th height=25 colspan=2>基本资料修改</td>
  71. </tr>
  72. <tr>
  73. <td width="40%" class=tablebody1><b>登 录 名:</b><br>此项不可修改,需要修改请与<a href=mailto:<%=txl_info(5)%>><u>管理员</u></a>联系!</td>
  74. <td width="60%" class=tablebody1> <b><%=rs("username")%> / <%=rs("realname")%></b></td>
  75. </tr>
  76. <tr>    
  77. <td width="40%" class=tablebody1><B>性&nbsp;&nbsp;&nbsp;&nbsp;别:</B><BR>请选择您的性别</td>   
  78. <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>   
  79. </tr>
  80. <tr>    
  81. <td width="40%" class=tablebody1><B>生&nbsp;&nbsp;&nbsp;&nbsp;日</B><BR>如不想填写,请全部留空</td>   
  82. <td width="60%" class=tablebody1>    
  83.   <select name=birthyear>
  84.   <option value=""></option>
  85.   <%for i=1901 to 2000%>
  86. <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>
  87.   <%next%>
  88.   </select>
  89.                     年 
  90.   <select name=birthmonth>
  91.   <option value=""></option>
  92.   <%for i=1 to 12%>
  93. <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>
  94.   <%next%>
  95.   </select>
  96.                     月 
  97.   <select name=birthday>
  98.   <option value=""></option>
  99.   <%for i=1 to 31%>
  100. <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>
  101.   <%next%>
  102.   </select>
  103.                     日</font>
  104. </td>   
  105. </tr>
  106. <TR> 
  107. <TD width=40% class=tablebody1><B>头&nbsp;&nbsp;&nbsp;&nbsp;像</B>:<BR>您可以选择一个个性图片,当你发表留言或帖子时将显示在您的名字下方。</TD>
  108. <TD width=60% class=tablebody1>
  109. <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">
  110. <%
  111. dim userregface
  112. for i=0 to txl_userfaceNum
  113. userregface=txl_info(10)&txl_userface(i)
  114. if trim(lcase(rs("userface"))) = trim(lcase(userregface)) then
  115. %>
  116. <option value="<%=txl_info(10)&txl_userface(i)%>" selected><%=txl_userface(i)%></option>
  117. <% else %> 
  118. <option value='<%=txl_info(10)&txl_userface(i)%>'><%=txl_userface(i)%></option> 
  119. <%
  120. end if 
  121. next
  122. %> 
  123. </select>
  124. &nbsp;<img id=face src="<%=rs("userface")%>"></td>
  125. </TR>
  126. <tr>
  127. <td width="40%" class=tablebody1><b>个人照片:</b><br>如果您有照片在网上,请输入网页地址。此项可选</td>
  128. <td width="60%" class=tablebody1> <INPUT type=text size=35 name="userphoto" value="<%=rs("userphoto")%>"> 如:http://www.163.com/photo.jpg</td>
  129. </tr>
  130. <tr>    
  131. <td valign=top width="40%" class=tablebody1><B>签&nbsp;&nbsp;&nbsp;&nbsp;名</B>:<BR>不能超过 250 个字符   <br>   文字将出现在您发表的文章的结尾处。</td>   
  132. <td width="60%" class=tablebody1> <textarea name="Signature" rows=5 cols=60 wrap=PHYSICAL>
  133. <%if rs("sign")<>"" then%>
  134. <%
  135. dim signtrue
  136. signtrue=replace(rs("sign"),"<BR>",chr(13))
  137. signtrue=replace(signtrue,"&nbsp;"," ")
  138. %><%=signtrue%><%end if%></textarea>   
  139. </td>   
  140. </tr>
  141. <tr> 
  142. <td colspan="2" width="100%" class=tablebody2 align="center"><input type=Submit value="更 新" name="Submit"> &nbsp; <input type="reset" name="Submit2" value="清 除"></td>
  143. </tr>  
  144. </form>
  145. </table><br>
  146. </td>
  147. </tr>
  148. </table>
  149. <%
  150. rs.close
  151. set rs=nothing
  152. end sub
  153. sub update()
  154. dim sex,userface,birthday
  155. if request("sex")="" then
  156. errmsg=errmsg+"<br>"+"<li>请选择您的性别。"
  157. founderr=true
  158. elseif request("sex")=0 or request("sex")=1 then
  159. sex=request("sex")
  160. else
  161. errmsg=errmsg+"<br>"+"<li>您输入的字符非法。"
  162. founderr=true
  163. end if
  164. if request("face")="" then
  165. errmsg=errmsg+"<br>"+"<li>请选择您的个性头像。"
  166. founderr=true
  167. else
  168. userface=request("face")
  169. end if
  170. if strLength(request("Signature"))>250 then
  171. errmsg=errmsg+"<br>"+"<li>签名只能在250个字符以内。"
  172. founderr=true
  173. end if
  174. if request.Form("birthyear")="" or request.form("birthmonth")="" or request.form("birthday")="" then
  175. birthday=""
  176. else
  177. birthday=trim(Request.Form("birthyear"))&"-"&trim(Request.Form("birthmonth"))&"-"&trim(Request.Form("birthday"))
  178. if not isdate(birthday) then birthday=""
  179. end if
  180. set rs=server.createobject("adodb.recordset")
  181. sql="Select * from [User] where userid="&userid
  182. rs.open sql,conn,1,3
  183. if rs.eof and rs.bof then
  184. errmsg=errmsg+"<br>"+"<li>该用户名不存在。"
  185. founderr=true
  186. else
  187. rs("userface")=replace(userface,"'","")
  188. rs("sex")=sex
  189. rs("userphoto")=request("userphoto")
  190. rs("sign")=trim(request("Signature"))
  191. if birthday<>"" then
  192. rs("birthday")=birthday
  193. end if
  194. rs.Update
  195. end if
  196. rs.close
  197. set rs=nothing
  198. end sub
  199. %>