📄 adminmodify.asp
字号:
<!--#INCLUDE FILE="checklogin1.asp" -->
<!--#INCLUDE FILE="theme.asp" -->
<html>
<head>
<title>修改个人资料</title>
<meta content="text/html; charset=gb2312" http-equiv="Content-Type">
<link href="include/site.css" type="text/css" rel="stylesheet">
</head>
<body alink=#333333 vlink=#333333 link=#333333 topmargin=0 leftmargin=0 bgColor="<%=bodycolor%>">
<%
if request("action")="update" then
dim userpwd,question,answer,realname,msn
dim email,homepage,oicq,bir_year,bir_month,bir_day
dim workshop,telephone,address
dim isemailshow,ishomepageshow,isoicqshow,ismsnshow,sex
call update()
else
call userinfo()
end if
sub userinfo()
set rs=conn.execute("Select * from admin where user='"&session("name")&"'")
hp=rs("homepage")
if rs("homepage")="" or isnull(rs("homepage")) then hp="http://"
%>
<br><p>
<script language="JavaScript" src="script/jsfun.js">
</script>
<FORM action="adminmodify.asp?action=update" method=post name="userform" onsubmit="return submitonce(this);">
<table cellpadding=0 cellspacing=0 border=0 width=500 bgcolor=<%=TableborderColor%> align=center>
<tr>
<td>
<table cellpadding=3 cellspacing=1 border=0 width=100% bgcolor=<%=TableborderColor%>>
<TBODY>
<TR align=middle >
<TD colSpan=2 height=24 bgcolor=<%=TabletitleColor%>></TD></TR>
<TR>
<TD colSpan=2 height=24 bgcolor=<%=TablebodyColor1%>> 1.个人信息</TD></TR>
<TR>
<TD width=150 bgcolor=<%=TablebodyColor2%>> 用 户 名 **</TD>
<TD bgcolor=<%=TablebodyColor2%>><%=htmlencode(session("name"))%></TD></TR>
<TR bgcolor=<%=TablebodyColor2%>>
<TD width=150> 真实姓名 **</TD>
<TD><INPUT type=text maxLength=16 size=13 name=realname class=txt value="<%=htmlencode(rs("realname"))%>">
</TD></TR>
<TR bgcolor=<%=TablebodyColor2%>>
<TD width=150> 密 码 **</TD>
<TD><INPUT type=password maxLength=16 size=13 name=userpwd class=txt value="<%=rs("userpwd")%>">
</TD></TR>
<TR bgcolor=<%=TablebodyColor2%>>
<TD width=150 height=32> 密码提示问题 **</TD>
<TD height=32><INPUT maxLength=50 size=27 name=question class=txt value="<%=htmlencode(rs("question"))%>">
</TD></TR>
<TR bgcolor=<%=TablebodyColor2%>>
<TD width=150 height=32> 取回密码答案 **</TD>
<TD height=32><INPUT maxLength=50 size=27 name=answer class=txt value="<%=htmlencode(rs("answer"))%>">
</TD></TR>
<TR bgcolor=<%=TablebodyColor2%>>
<TD width=150 height=32> 电子邮件 **</TD>
<TD height=32><INPUT maxLength=50 size=27 name=email class=txt value="<%=htmlencode(rs("email"))%>"> <input type="checkbox" name="isemailshow" value="0" <%if rs("isemailshow")=false then response.write "checked"%>>保密
</TD></TR>
<TR bgcolor=<%=Tablebodycolor2%>>
<TD width=150> 性 别</TD>
<TD> <input type="radio" name="sex" value=false <% if rs("sex")=false then response.write "checked" %> >
先生
<input type="radio" name="sex" value=true <% if rs("sex")=true then response.write "checked" %> >
女士
</TD></TR>
<TR bgcolor=<%=Tablebodycolor2%>>
<TD width=150> 生 日 **</TD>
<td nowrap height="26"><input maxLength="4" name="year" size="4" class="txt" value=<%=rs("bir_year")%>> 年 <input maxLength="4" name="month" size="2" class="txt" value=<%=rs("bir_month")%>> 月 <input maxLength="4" name="day" size="2" class="txt" value=<%=rs("bir_day")%>> 日
</TD></TR>
<TR bgcolor=<%=Tablebodycolor2%>>
<TD width=150> 主页地址</TD>
<TD><input name="homepage" size="27" value="<%=htmlencode(hp)%>" class=txt value="<%=rs("homepage")%>"> <input type="checkbox" name="ishomepageshow" value="0" <%if rs("ishomepageshow")=false then response.write "checked"%>>保密</td></TD></TR>
<TR bgcolor=<%=Tablebodycolor2%>>
<TD width=150> OICQ号码</TD>
<TD><INPUT maxLength=20 size=27 name=oicq class=txt value="<%=rs("oicq")%>"> <input type="checkbox" name="isoicqshow" value="0" <%if rs("isoicqshow")=false then response.write "checked"%>>保密 </TD></TR>
<TR bgcolor=<%=Tablebodycolor2%>>
<TD width=150> MSN号码</TD>
<TD><input type="text" name="msn" size="27" class="txt" value=<%=rs("msn")%>> <input type="checkbox" name="ismsnshow" value="0" <%if rs("ismsnshow")=false then response.write "checked"%>>保密</TD></TR>
<TR bgcolor=<%=Tablebodycolor2%>>
<TD width=150> 联系电话</TD>
<TD><INPUT maxLength=20 size=27 name=telephone class=txt value="<%=rs("telephone")%>"> </TD></TR>
<TR bgcolor=<%=Tablebodycolor2%>>
<TD width=150> 工作单位</TD>
<TD><INPUT maxLength=20 size=27 name=workshop class=txt value="<%=rs("workshop")%>"> </TD></TR>
<TR bgcolor=<%=Tablebodycolor2%>>
<TD width=150> 通信地址</TD>
<TD><INPUT maxLength=20 size=44 name=address class=txt value="<%=htmlencode(rs("address"))%>"> </TD></TR>
<TR>
<TD colSpan=2 height=24 bgcolor=<%=TablebodyColor1%>> 2.系统配色方案</TD></TR>
<TR bgcolor=<%=Tablebodycolor2%>>
<TD width=150> 配色方案</TD>
<TD><%call ThemeList(rs("theme"))%>
</TD></TR>
<TR align=middle bgcolor=<%=Tabletitlecolor%>>
<TD colSpan=2><DIV align=center><INPUT value="更 新" name=Submit type=submit> <INPUT type=reset value="重 写" name=Submit2>
</DIV>
</TD></TR>
</TBODY></TABLE></td></tr></table>
</FORM>
<%
end sub
sub update()
if chkinput=false then
exit sub
end if
dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
StrSQL = "select * from [admin] where user='"&session("name")&"'"
rs.open StrSQL,conn,1,3
if rs.eof and rs.bof then
errmsg=errmsg+"<br>"+"<li>该用户名不存在!"
call error(errmsg)
exit sub
end if
rs("bir_year")=bir_year
rs("bir_month")=bir_month
rs("bir_day")=bir_day
rs("userpwd")=userpwd
rs("question")=question
rs("answer")=answer
rs("homepage")=homepage
rs("ishomepageshow")=ishomepageshow
rs("realname")=realname
rs("email")=email
rs("isemailshow")=isemailshow
rs("oicq")=oicq
rs("isoicqshow")=isoicqshow
rs("msn")=msn
rs("ismsnshow")=ismsnshow
rs("telephone")=telephone
rs("workshop")=workshop
rs("address")=address
rs("theme")=request("theme")
rs("sex")=sex
rs.Update
rs.close
set rs=nothing
stitle="修改资料"
smsg="您已经成功的修改了您的个人信息和个人选项。"
call success(stitle,smsg)
end sub
function chkinput()
if chkpost=false then
ErrMsg=ErrMsg+"<Br>"+"<li>您提交的数据不合法,请不要从"&Version&"外部提交信息。"
call error(errmsg)
chkinput=false
exit function
end if
realname=trim(request.form("realname"))
if realname="" then
errmsg=errmsg+"<br>"+"<li>真实姓名不能为空。"
founderr=true
elseif not isChinese(realname) then
errmsg=errmsg+"<br>"+"<li>真实姓名应为汉字。"
founderr=true
elseif strLength(realname)<4 or strLength(realname)>8 then
errmsg=errmsg+"<br>"+"<li>真实姓名输入有误!"
founderr=true
end if
userpwd=request.form("userpwd")
if userpwd="" then
errmsg=errmsg+"<br>"+"<li>请确认输入了密码(6-10个字符)!"
founderr=true
elseif strlength(userpwd)<6 or strlength(userpwd)>10 then
errmsg=errmsg+"<br>"+"<li>密码不能少于六个字符或多余十个字符!"
founderr=true
elseif isValidstring(userpwd)<>"" then
if isValidstring(userpwd)=" " then invld="空格" else invld=isValidstring(userpwd)
errmsg=errmsg+"<br>"+"<li>密码中含有非法字符 <font color=#cc0000>"&invld&"</font> 。"
founderr=true
end if
question=trim(request.form("question"))
if question="" then
errmsg=errmsg+"<br>"+"<li>请输入取回密码提示!"
founderr=true
end if
answer=trim(request.form("answer"))
if answer="" then
errmsg=errmsg+"<br>"+"<li>请输入取回密码答案!"
founderr=true
end if
bir_year=cint(request.form("year"))
if strlength(bir_year)<>4 then
errmsg=errmsg+"<br>"+"<li>生日年份应为四位数字!"
founderr=true
elseif not isInteger(bir_year) then
errmsg=errmsg+"<br>"+"<li>生日年份应为数字!"
founderr=true
elseif bir_year>cint(year(date)) or bir_year<(cint(year(date))-60) then
errmsg=errmsg+"<br>"+"<li>请输入正确的用户出生年份!"
founderr=true
end if
bir_month=cint(request.form("month"))
bir_day=cint(request.form("day"))
if (bir_month=4 or bir_month=6 or bir_month=9 or bir_month=11) and bir_day=31 then
errmsg=errmsg+"<br>"+"<li>错误的生日日期!"
founderr=true
elseif (bir_day=29 or bir_day=30 or bir_day=31) and (bir_year mod 4)<>0 and bir_month=2 then
errmsg=errmsg+"<br>"+"<li>错误的生日日期!"
founderr=true
elseif (bir_day=29 or bir_day=30 or bir_day=31) and (bir_year mod 4)=0 and (bir_year mod 400)<>0 and bir_month=2 then
errmsg=errmsg+"<br>"+"<li>错误的生日日期!"
founderr=true
elseif (bir_day=30 or bir_day=31) and (bir_year mod 4)=0 and bir_month=2 then
errmsg=errmsg+"<br>"+"<li>错误的生日日期!"
founderr=true
end if
email=trim(request.form("email"))
if email="" then
errmsg=errmsg+"<br>"+"<li>邮件地址不能为空。"
founderr=true
elseif not isValidEmail(email) then
errmsg=errmsg+"<br>"+"<li>电子邮件地址输入有误!"
founderr=true
end if
if request.form("isemailshow")="0" then
isemailshow=false
else
isemailshow=true
end if
sex=request.form("sex")
homepage=trim(request.form("homepage"))
if request.form("ishomepageshow")="0" then
ishomepageshow=false
else
ishomepageshow=true
end if
oicq=trim(request.form("oicq"))
if oicq<>"" and (strLength(oicq)<2 or strLength(oicq)>10 or not isinteger(oicq)) then
errmsg=errmsg+"<br>"+"<li>OICQ输入有误!"
founderr=true
end if
if request.form("isoicqshow")="0" then
isoicqshow=false
else
isoicqshow=true
end if
msn=trim(request.form("msn"))
if msn<>"" and not isValidEmail(msn) then
errmsg=errmsg+"<br>"+"<li>MSN号码输入有误!"
founderr=true
end if
if request.form("ismsnshow")="0" then
ismsnshow=false
else
ismsnshow=true
end if
telephone=request.form("telephone")
if telephone<>"" and not IsValidTel(telephone) then
errmsg=errmsg+"<br>"+"<li>电话号码输入错误"
founderr=true
end if
workshop=trim(request.form("workshop"))
address=trim(request.form("address"))
if founderr=true then
call error(errmsg)
chkinput=false
else
chkinput=true
end if
end function
%>
<!--#INCLUDE FILE="footer.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -