?? usermod.asp
字號:
<!--#include file="conn.asp"-->
<!--#include file="email.asp"-->
<!--#include file="const.asp"-->
<%if session("user")="" then
response.redirect "err.asp"
end if%>
<%
action=request("action")
user=session("user")
errstr=""
err=flase
'取用戶資料
set rs=server.createobject("ADODB.recordset")
sql="select * from user where user='"&user&"'"
rs.open sql,conn,1,3
if rs.bof or rs.eof then
err=true
errstr="<br><br><br><br><br><br><b>對不起,找不到該用戶"
else
id=rs("id")
realname=rs("realname")
sex=rs("sex")
byear=rs("byear")
bmonth=rs("bmonth")
bday=rs("bday")
password=rs("password")
face=rs("userimage")
question=rs("question")
answer=rs("answer")
address=rs("address")
telephone=rs("telephone")
mobile=rs("mobile")
bp=rs("bp")
qq=rs("qq")
workshop=rs("workshop")
homeaddr=rs("homeaddr")
email=rs("email")
addinfo=rs("addinfo")
rs.close
end if%>
<!--#include file="top.asp"-->
<% if err<>"true" and action<>"mod" then%>
<table width="100%" border="0" cellspacing="2" cellpadding="2" class=bk bgcolor="#ffffff">
<form name="form1" method="post" action="usermod.asp?action=mod">
<tr>
<td width="130" align="right">用戶名:</td>
<td width="370"><%=user%>
</td>
</tr> <tr>
<td width="130" align="right">真實姓名:<br>
</td>
<td height="15" width="370">
<%=realname%></td>
</tr>
<tr>
<td width="130" align="right">原密碼:</td>
<td width="370"><input type=password value="<%=password%>"></td>
</tr>
<tr>
<td width="130" align="right">修改密碼:</td>
<td width="370">
<input type="password" name="password" onmouseover="window.document.form1.password.select();">
!!(多于5位,少于15位)</td>
</tr>
<tr>
<td width="130" align="right">重復密碼:</td>
<td width="370">
<input type="password" name="password2" onmouseover="window.document.form1.password2.select();">
!!</td>
</tr>
<tr>
<td width="130" align=right>
頭像:</td>
<td width="370">
<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">
<% for i=1 to 137%>
<option value="face/<%=i%>.gif" <% if face="face/"&i&".gif" then response.write "selected" end if%>>頭像<%=i%></option>"
<%next
%>
</select><img id=face src="<%=face%>" alt=個人形象代表>**</td>
</tr>
<tr>
<td width="130" align="right">性別:</td>
<td width="370"> <%if sex="1" then
response.write "帥哥"
elseif sex="2" then
response.write "靚妹"
else
response.write "神秘人"
end if%>
</select>
</td>
</tr>
<tr>
<td width="130" align="right">您的生日:</td>
<td width="370">
<select name="byear" size="1" style="font-size: 9pt">
<% for i=1975 to 1984 %>
<option value="<%=i%>" <%if byear=i then response.write "selected" end if%>><%=i%></option>
<%next%>
</select>
年
<select name="bmonth" size="1" style="font-size: 9pt">
<% for i=1 to 12%>
<option value="<%=i%>" <%if bmonth=i then response.write "selected" end if%>><%=i%></option>
<%next%>
</select>
月
<select name="bday" size="1" style="font-size: 9pt">
<% for i=1 to 31%>
<option value="<%=i%>" <%if bday=i then response.write "selected" end if%>><%=i%></option>
<%next%>
</select>
日 </td>
</tr>
<tr>
<td width="130" align="right">密碼丟失提示問題:</td>
<td width="370">
<input type="text" name="question" onmouseover="window.document.form1.question.select();" value="<%=question%>">
(例如您的身份證號碼?)</td>
</tr>
<tr>
<td width="130" align="right">提示答案:</td>
<td width="370">
<input type="text" name="answer" onmouseover="window.document.form1.answer.select();" value="<%=answer%>">
</td>
</tr>
<tr>
<td width="130" align="right">通信地址(郵編):</td>
<td width="370">
<input type="text" name="address" size="40" onmouseover="window.document.form1.address.select();" value="<%=address%>">
</td>
</tr>
<tr>
<td width="130" align="right">固定電話:</td>
<td width="370">
<input type="text" name="telephone" onmouseover="window.document.form1.telephone.select();" value="<%=telephone%>">
</td>
</tr>
<tr>
<td width="130" align="right">移動電話:</td>
<td width="370">
<input type="text" name="mobile"onmouseover="window.document.form1.mobile.select();" value="<%=mobile%>">
</td>
</tr>
<tr>
<td width="130" align="right">傳呼:</td>
<td width="370">
<input type="text" name="bp" onmouseover="window.document.form1.bp.select();" value="<%=bp%>">
</td>
</tr>
<tr>
<td width="130" align="right">OICQ/ICQ 號碼:</td>
<td width="370">
<input type="text" name="qq" onmouseover="window.document.form1.qq.select();" value="<%=qq%>">
</td>
</tr>
<tr>
<td width="130" align="right">工作單位:</td>
<td width="370">
<input type="text" name="workshop" size="40" onmouseover="window.document.form1.workshop.select();" value="<%=workshop%>">
</td>
</tr>
<tr>
<td width="130" align="right">家庭居住地址:</td>
<td width="370">
<input type="text" name="homeaddr" onmouseover="window.document.form1.homeaddr.select();" value="<%=homeaddr%>">
</td>
</tr>
<tr>
<td width="130" align="right">電子郵件地址:</td>
<td width="370">
<input type="text" name="email" onmouseover="window.document.form1.email.select();" value="<%=email%>">
!! </td>
</tr>
<tr>
<td width="130" align="right">附加信息:</td>
<td width="370">
<textarea name="addinfo" rows="5" cols="35" onmouseover="window.document.form1.addinfo.select();"><%=addinfo%></textarea>
</td>
</tr>
<tr>
<td width="130" align="right"> </td>
<td width="370" height="50" valign="bottom">
<input type="image" src="image/1-sub.gif">  
<a href="javascript:reset()"><img border="0" src="image/1-reset.gif" width="44" height="23"></a>   </td>
</tr>
</form>
</table>
<% end if%>
<%
function encrypt(preString)
Dim texts
Dim seed
Dim i,length
prestring = trim(preString)
length = len(preString)
seed = length
Randomize(length)
texts = ""
for i = 1 to length
seed = int(94*rnd(-asc(mid(preString,i,1))-seed*asc(right(prestring,1)))+32)
texts = texts & chr(seed) & chr(int(94*rnd(-seed)+32))
next
dim dist
dist=""
for i = 1 to len(texts)
if mid(texts,i,1)<>"'" then
dist=dist+mid(texts,i,1)
end if
next
encrypt = dist
end function
if err<>"true" and action="mod" then
password1=trim(request.form("password"))
password1=encrypt(password1)
face1=trim(request("face"))
sex1=trim(request("sex"))
byear1=trim(request("byear"))
bmonth1=trim(request("bmonth"))
bday1=trim(request("bday"))
question1=trim(request("question"))
answer1=trim(request("answer"))
address1=trim(request("address"))
telephone1=trim(request("telephone"))
mobile1=trim(request("mobile"))
bp1=trim(request("bp"))
qq1=trim(request("qq"))
workshop1=trim(request("workshop"))
homeaddr1=trim(request("homeaddr"))
email1=trim(request.form("email"))
addinfo1=trim(request("addinfo"))
if password1="" then
password1=password
end if
if email1="" then
dataerr="true"
errstr=errstr&"對不起,email為空,請<a href=usermod.asp><font color=red>返回</font></a>重寫"
end if
if trim(request("password"))<>"" and trim(request.form("password"))<>trim(request.form("password2")) then
dataerr="true"
errstr=errstr&"對不起,你欲修改密碼,但兩次輸入的密碼卻不一樣!請<a href=usermod.asp><font color=red>返回</font></a>重寫"
end if
if email1<>"" and Isemail(trim(request.form("email")))=false then
dataerr="true"
errstr=errstr&"對不起,eamil格式不對,請<a href=usermod.asp><font color=red>返回</font></a>重寫"
end if
if dataerr<>"true" then
conn.execute "update user set password='"&password1&"',userimage='"&face1&"',byear="&byear1&",bmonth="&bmonth1&",bday="&bday1&",question='"&question1&"',answer='"&answer1&"',address='"&address1&"',telephone='"&telephone1&"',mobile='"&mobile1&"',bp='"&bp1&"',qq='"&qq1&"',workshop='"&workshop1&"',homeaddr='"&homeaddr1&"',email='"&email1&"',addinfo='"&addinfo1&"' where id="&id
errstr="祝賀你,修改成功!<a href=usermod.asp><font color=red>返回</font></a>查看"
end if
if dataerr="true" then
response.write "<table width=100%' class=bk bgcolor=#ffffff height=250><tr><td align=center><img src=image/err.gif><br><br>"&errstr&"</td></tr></table>"
else
response.write "<table width=100%' class=bk bgcolor=#ffffff height=250><tr><td align=center><img src=image/success.jpg><br><br>"&errstr&"</td></tr></table>"
end if
end if%>
<!--#include file="end.asp"-->
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -