📄 profileedit.asp
字号:
<!-- #include file="const.asp" -->
<%
dim sql,rs,name,action1,password
name=trim1(request.Cookies("matrix3")("matrix3_name"))
password=trim1(request.Cookies("matrix3")("matrix3_pw"))
action1=trim(request.Form("action1"))
if name="" or password="" then
response.Redirect("error.asp?id=3")
response.End()
end if
call opendb()
if action1="DONE" then
sql="select * from m3_users where name='"&name&"' and password='"&password&"'"
set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,3
if rs.eof and rs.bof then
rs.close
set rs=nothing
call closedb()
response.Redirect("error.asp?id=2")
response.End()
else
rs("nickname") =server.HTMLEncode(left(request.Form("nickname"),30))
rs("phone") =server.HTMLEncode(left(request.Form("phone"),30))
rs("mobile") =server.HTMLEncode(left(request.Form("mobile"),30))
rs("birthday") =server.HTMLEncode(left(request.Form("birthday"),10))
rs("country") =server.HTMLEncode(left(request.Form("country"),50))
rs("city") =server.HTMLEncode(left(request.Form("city"),50))
rs("industry") =server.HTMLEncode(left(request.Form("industry"),50))
rs("icq") =server.HTMLEncode(left(request.Form("icq"),20))
rs("msn") =server.HTMLEncode(left(request.Form("msn"),30))
rs("yahoo") =server.HTMLEncode(left(request.Form("yahoo"),30))
rs("qq") =server.HTMLEncode(left(request.Form("qq"),10))
rs("touxiang") =server.HTMLEncode(left(request.Form("touxiang"),150))
rs("website") =server.HTMLEncode(left(request.Form("website"),150))
rs("hobby") =server.HTMLEncode(left(request.Form("hobby"),100))
rs("signature") =server.HTMLEncode(left(request.Form("signature"),250))
rs("pub") =cint(request.Form("pub"))
rs("messkey") =cint(request.Form("messkey"))
rs("sex") =request.Form("gender")
rs.update
end if
rs.close
set rs=nothing
response.write("<script>alert('更新成功 !');location.href='myprofile.asp';</script>")
response.End()
else
position "编辑个人简介",0
sql="select * from m3_users where name='"&name&"' and password='"&password&"'"
set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
rs.close
set rs=nothing
call closedb()
response.Redirect("error.asp?id=2")
response.End()
else
%>
<html>
<head>
<title><%=sitename%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
function tx(src,win_width,win_height)
{
window.open(src,'','width='+win_width+',height='+win_height+',resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no');
return false;
}
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="10" align="center" valign="top"><!-- #include file="topbar.asp" --></td>
</tr>
<tr>
<td align="center" valign="top"><table width="100%" height="60%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10" align="center" valign="top" bgcolor="#ECE9D9"> </td>
<td width="1" bgcolor="#E8BC3C"></td>
<td width="10"> </td>
<td align="center" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="100%" height="30" class=v8b><img src="images/btn_face.gif" width="10" height="7">
<font color="#990000">我的个人简介 > 编辑</font></td>
</tr>
<tr>
<td height="1" bgcolor="#ECE9D9"></td>
</tr>
</table>
<br> <table width="96%" border="0" cellpadding="2" cellspacing="1" bgcolor="#E8BC3C">
<tr background="images/bg4.gif">
<td width="50%" background="images/bg4.gif"> </td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="#FFFFFF"> <br> <form action="" method="post" name="mform" onSubmit="javascript:chkField();return false;">
<table width="52%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td align="right" class=v8b><font color="#990000">帐号:</font></td>
<td class=v8b> <%=rs("name")%></td>
</tr>
<tr>
<td width="126" align="right"><font color="#0000FF">昵称:</font></td>
<td width="331"> <input name="nickname" type="text" id="nickname" class="input1" value="<%=rs("nickname")%>" size="30" maxlength="30">
</td>
</tr>
<tr>
<td align="right"><font color="#0000FF">性别:</font></td>
<td> <input type="radio" name="gender" value="0" <%if rs("sex")="0" then response.write("checked")%>>
男
<input type="radio" name="gender" value="1" <%if rs("sex")="1" then response.write("checked")%>>
女</td>
</tr>
<tr>
<td align="right"><font color="#0000FF">自定义头像:</font></td>
<td nowrap>
<input name="touxiang" type="text" id="touxiang" class="input1" value="<%=rs("touxiang")%>" size="45" maxlength="150">
<a href="#" onClick="tx('touxiang.asp',550,600)"><font color="#FF0000"><u>
选择头像</u></font></a></td>
</tr>
<tr>
<td align="right"><font color="#0000FF">Email:</font></td>
<td class=v8b><input name="email" class="input1" type="text" id="email" value="<%=rs("email")%>" size="30" maxlength="30"></td>
</tr>
<tr>
<td align="right"> <input name="messkey" type="checkbox" id="messkey" value="1" <%if rs("messkey")=1 then response.write("checked")%>>
</td>
<td> <p> 允许别人给我发信息</p></td>
</tr>
<tr>
<td align="right"><font color="#0000FF">电话:</font></td>
<td> <input name="phone" type="text" id="phone" class="input1" value="<%=rs("phone")%>" size="30" maxlength="30">
</td>
</tr>
<tr>
<td align="right"><font color="#0000FF">手机:</font></td>
<td> <input name="mobile" type="text" id="mobile" class="input1" value="<%=rs("mobile")%>" size="30" maxlength="20">
</td>
</tr>
<tr>
<td align="right"><font color="#0000FF">出生年月:</font></td>
<td> <input name="birthday" type="text" id="birthday" class="input1" value="<%if rs("birthday")="" then
response.write"0000-00-00"
else
response.write(rs("birthday"))
end if%>" size="10" maxlength="10">
(例:1980-12-30) </td>
</tr>
<tr>
<td align="right"><font color="#0000FF">国家/地区:</font></td>
<td><input name="country" type="text" id="country" value="<%=rs("country")%>" size="20" maxlength="50"> </td>
</tr>
<tr>
<td align="right"><font color="#0000FF">城市:</font></td>
<td> <input name="city" type="text" id="city" class="input1" value="<%=rs("city")%>" size="30" maxlength="30">
</td>
</tr>
<tr>
<td align="right"><font color="#0000FF">行业:</font></td>
<td> <input name="industry" type="text" id="industry" value="<%=rs("industry")%>" size="26" maxlength="50"></td>
</tr>
<tr>
<td align="right"><font color="#0000FF">ICQ:</font></td>
<td> <input name="icq" type="text" id="icq" class="input1" value="<%=rs("icq")%>" size="30" maxlength="20">
</td>
</tr>
<tr>
<td align="right"><font color="#0000FF">MSN:</font></td>
<td> <input name="msn" type="text" id="msn" class="input1" value="<%=rs("msn")%>" size="30" maxlength="30">
</td>
</tr>
<tr>
<td align="right"><font color="#0000FF">Yahoo:</font></td>
<td> <input name="yahoo" type="text" id="yahoo" class="input1" value="<%=rs("yahoo")%>" size="30" maxlength="30">
</td>
</tr>
<tr>
<td align="right"><font color="#0000FF">QQ:</font></td>
<td> <input name="qq" type="text" id="qq" class="input1" value="<%=rs("qq")%>" size="30" maxlength="20">
</td>
</tr>
<tr>
<td align="right"><font color="#0000FF">网站:</font></td>
<td> <input name="website" type="text" id="website" class="input1" value="<%=rs("website")%>" size="50" maxlength="150">
</td>
</tr>
<tr>
<td align="right"><font color="#0000FF">个人爱好:</font></td>
<td> <input name="hobby" type="text" id="hobby" class="input1" value="<%=rs("hobby")%>" size="40" maxlength="200">
</td>
</tr>
<tr>
<td align="right" valign="top"><font color="#0000FF">签名档:<br>
(250字以内) </font></td>
<td> <textarea name="signature" id="signature" class="input1" cols="40" rows="4"><%=rs("signature")%></textarea>
</td>
</tr>
<tr>
<td align="right" valign="top"> <input name="pub" type="checkbox" id="pub" value="1" <%if rs("pub")=1 then response.write("checked")%>>
</td>
<td>允许别人查看我的个人简介</td>
</tr>
<tr>
<td align="right" valign="top"> </td>
<td height="50"> <input type="submit" name="Submit1" value="更新我的个人简介" class="input">
<input name="action1" type="hidden" id="action1" value="DONE">
<input name="cancel" type="button" class="input" id="cancel" value="取消" onClick="history.go(-1)">
</td>
</tr>
</table>
<SCRIPT language=JavaScript>
function chkField()
{
if (document.mform.nickname.value.length >20)
{
alert ('昵称不能超过20个字符');
document.mform.nickname.focus();
return false;
}
document.mform.submit();
document.mform.Submit1.disabled=true;
}
</script>
</form>
<br> </td>
</tr>
</table>
<br> </td>
<td width="10"> </td>
<td width="1" bgcolor="#E8BC3C"></td>
<td width="100" bgcolor="#ECE9D9" valign="top">
<!-- #include file="right.asp" -->
</td>
</tr>
</table></td>
</tr>
<tr>
<td height="10" align="center" valign="bottom">
<!-- #include file="bottombar.asp" -->
</td>
</tr>
</table>
</body>
</html>
<%
end if
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -