?? mymodify.asp
字號:
<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!-- #include file="chkuser.asp" -->
<!--#include file="inc/char.asp"-->
<!--#include file="inc/theme.asp"-->
<!--#include file="md5.asp"-->
<%
stats="修改資料"
if membername="" then
errmsg=errmsg+"<br>"+"<li>您沒有<a href=login.asp target=_blank>登錄</a>。"
founderr=true
else
if request("action")="update" then
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("showRe")="" then
errmsg=errmsg+"<br>"+"<li>請選擇有回帖時是否提示您。"
founderr=true
elseif request("showRe")=0 or request("showRe")=1 then
showRe=request("showRe")
else
errmsg=errmsg+"<br>"+"<li>您輸入的字符非法。"
founderr=true
end if
if request("psw")="" then
errmsg=errmsg+"<br>"+"<li>請輸入您的密碼。"
founderr=true
elseif trim(request("psw"))=trim(memberword) then
password=request("psw")
else
password=md5(request("psw"))
end if
if request("quesion")="" then
errmsg=errmsg+"<br>"+"<li>請輸入密碼提示問題。"
founderr=true
else
quesion=request("quesion")
end if
if request("answer")="" then
errmsg=errmsg+"<br>"+"<li>請輸入密碼提示問題答案。"
founderr=true
elseif request("answer")=request("oldanswer") then
answer=request("answer")
else
answer=md5(request("answer"))
end if
if request("myface")<>"" then
if request("width")="" or request("height")="" then
errmsg=errmsg+"<br>"+"<li>請輸入圖片的寬度和高度。"
founderr=true
elseif not isInteger(request("width")) or not isInteger(request("height")) then
errmsg=errmsg+"<br>"+"<li>您輸入的字符不合法。"
founderr=true
elseif request("width")<20 or request("width")>80 then
errmsg=errmsg+"<br>"+"<li>您輸入的圖片寬度不符合標準。"
founderr=true
elseif request("height")<20 or request("height")>80 then
errmsg=errmsg+"<br>"+"<li>您輸入的圖片高度不符合標準。"
founderr=true
else
face=request("myface")
width=request("width")
height=request("height")
end if
else
if request("face")="" then
errmsg=errmsg+"<br>"+"<li>請選擇您的個性頭像。"
founderr=true
elseif Instr(request("face"),picurl)>0 then
face=request("face")
width=32
height=32
else
errmsg=errmsg+"<br>"+"<li>您選擇了錯誤的頭像。"
founderr=true
end if
end if
if IsValidEmail(request("Email"))=false then
errmsg=errmsg+"<br>"+"<li>您的Email有錯誤。"
founderr=true
else
Email=request("Email")
end if
if request("oicq")<>"" then
if not isnumeric(request("oicq")) or len(request("oicq"))>10 then
errmsg=errmsg+"<br>"+"<li>Oicq號碼只能是4-10位數字,您可以選擇不輸入。"
founderr=true
end if
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"))
end if
else
call nav()
call headline(1)
call userinfo()
end if
end if
if founderr then
call nav()
call headline(1)
call error()
else
if request("action")="update" then
if founderr then
call nav()
call headline(1)
call error()
else
call update()
call nav()
call headline(1)
if founderr then
call error()
else
call success()
end if
end if
end if
end if
call endline()
sub userinfo()
set rs=server.createobject("adodb.recordset")
sql="Select * from [User] where username='"&trim(membername)&"'"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
errmsg=errmsg+"<br>"+"<li>該用戶名不存在。"
founderr=true
else
%>
<form action="mymodify.asp?action=update&username=<%=htmlencode(membername)%>" method=POST name="theForm">
<table cellpadding=0 cellspacing=0 border=0 width=<%=tablewidth%> bgcolor=<%=Tablebackcolor%> align=center>
<tr>
<td>
<table cellpadding=3 cellspacing=1 border=0 width=100%>
<tr align="center">
<td colspan="2" width="100%" bgcolor=<%=Tabletitlecolor%> height=25><font color="<%=TablefontColor%>"><b><%=htmlencode(RS("username"))%>修改資料</b></font></td>
</tr>
<tr bgcolor=<%=Tablebodycolor%>>
<td width="40%"><font color="<%=TableContentColor%>"><B>性別</B>:<BR>請選擇您的性別</font></td>
<td width="60%"><input type="radio" value="1"<%if rs("sex")=1 then%> checked <%end if%>name="Sex">酷哥
<input type="radio" name="Sex"<%if rs("sex")=0 then%> checked <%end if%> value="0">靚妹</td>
</td>
</tr>
<tr bgcolor=<%=Tablebodycolor%>>
<td width="40%"><font color="<%=TableContentColor%>"><B>密碼</B>:<BR>如要修改請直接輸入</font></td>
<td width="60%">
<input type="password" name="psw" value="<%=htmlencode(RS("userpassword"))%>" size=30 maxlength=13>
</td>
</tr>
<tr bgcolor=<%=Tablebodycolor%>>
<td width="40%"><font color="<%=TableContentColor%>"><B>密碼問題</B>:<BR>請填寫做為密碼答案依據</font></td>
<td width="60%">
<input type=text name="quesion" size=30 value="<%=htmlencode(rs("quesion"))%>">
</td>
</tr>
<tr bgcolor=<%=Tablebodycolor%>>
<td width="40%"><font color="<%=TableContentColor%>"><B>問題答案</B>:<BR>請認真填寫以便您日后取回密碼<BR>答案采用了MD5加密,只供取回密碼使用,如要修改可直接填寫。</font></td>
<td width="60%">
<input type=text name="answer" size=30 value="<%=htmlencode(rs("answer"))%>">
<input type=hidden name="oldanswer" value="<%=htmlencode(rs("answer"))%>">
</td>
</tr>
<tr bgcolor=<%=Tablebodycolor%>>
<td width="40%"><font color="<%=TableContentColor%>"><B>Email地址</B>:<BR>請輸入有效的郵件地址,這將保證您在論壇中的私人資料。</font></td>
<td width="60%">
<input type="TEXT" name="Email" size=30 maxlength=50 value="<%if trim(rs("useremail"))<>"" then%><%=htmlencode(rs("useremail"))%><%end if%>">
</td>
</tr>
<tr bgcolor=<%=Tablebodycolor%>>
<td width="40%"><font color="<%=TableContentColor%>"><B>生日</B><BR>如不想填寫,請全部留空</font></td>
<td width="60%"> <font color="<%=TableContentColor%>">
<select name=birthyear>
<option value=""></option>
<%for i=1901 to 2000%>
<option value="<%=i%>" <%if not isnull(rs("birthday")) or 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")) or 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")) or rs("birthday")<>"" then%><%if cint(day(rs("birthday")))=cint(i) then response.write "selected"%><%end if%>><%=i%></option>
<%next%>
</select>
日</font>
</td>
</tr>
<%if cint(TitleFlag)=1 then%>
<%if rs("userclass")>5 then%>
<tr bgcolor=<%=Tablebodycolor%>>
<td width="40%"><font color="<%=TableContentColor%>"><B>頭銜</B>:</font></td>
<td width="60%"> <input type="text" name="title" value="<%if trim(rs("title"))<>"" then%><%=htmlencode(RS("title"))%><%end if%>" size=15 maxlength=13> </td>
</tr>
<%end if%>
<%end if%>
<tr bgcolor=<%=Tablebodycolor%>>
<td width="40%" valign=top><font color="<%=TableContentColor%>"><B>頭像</B>:<BR>
您可以選擇一個個性圖片,當你發表時將顯示在您的名字下方。<BR>
如果你填寫了下面的自定義頭像部分,那么你的頭像以自定義的為準。否則,請你留空自定義頭像的所有欄目!<BR>
<B>關于自定義頭像</B>:<BR>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -