📄 mymodify.asp
字号:
<%response.expires=0%>
<!--#INCLUDE FILE="conn.asp" -->
<!--#INCLUDE FILE="const.asp" -->
<!--#INCLUDE FILE="char.asp" -->
<!--#INCLUDE FILE="checkuser.asp" -->
<!--#INCLUDE FILE="theme.asp" -->
<html>
<head>
<title><%=SchoolmateName%>——修改个人资料</title>
<meta content="text/html; charset=gb2312" http-equiv="Content-Type">
<link href="txl.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,face,zipcode,address,maxim
dim isemailshow,ishomepageshow,isoicqshow,ismsnshow,sex
dim NewMemberFlag,NewAnnounceFlag
call update()
elseif request("action")="exitpass" then
call exitpass()
else
call userinfo()
end if
call endconnection()
sub exitpass()
dim tmpsql
tmpsql="update [student] set classid=0,enyear='',status=false where userid='"&membername&"'"
conn.execute(tmpsql)
stitle="退出审核"
smsg="你已经成功的退出班级管理员的审核状态!"
call success(stitle,smsg)
end sub
sub userinfo()
set rs=conn.execute("Select * from student where userid='"&membername&"'")
face=rs("image")
if isnull(face) or face="" then face="face/Image1.gif"
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="mymodify.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%>><img src=images/modify.gif></TD></TR>
<TR>
<TD colSpan=2 height=24 bgcolor=<%=TablebodyColor1%>> 1.个人信息</TD></TR>
<TR>
<TD width=150 bgcolor=<%=TablebodyColor2%>> 用 户 名 **</TD>
<TD bgcolor=<%=TablebodyColor2%>><%=htmlencode(membername)%></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 height=32> 形象 <img id=face src="<%=face%>" alt=个人形象代表 width=24 height=24>**</TD>
<TD height=32>
<select name=face size=1 onChange="document.images['face'].src=options[selectedIndex].value;" class="txt">
<%for i=1 to 60%>
<option value="<%=FaceURL%>Image<%=i%>.gif" <%if FaceURL&"Image"&i&".gif"=face then%>selected <%end if%>>Image<%=i%></option>
<%next%>
</select> [<a href="javascript:openScript('help.asp?action=portraitList',320,250)">头像列表</a>]</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=27 name=zipcode class=txt value="<%=rs("zipcode")%>"> </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 bgcolor=<%=Tablebodycolor2%>>
<TD width=150> 人生格言<BR><BR>文字将出现在您发表的文章的结尾处。体现您的个性(支持<font color=brown>UBB</font>代码)。 </TD>
<TD><TEXTAREA name=maxim rows=5 wrap=PHYSICAL cols=42 class=txt value=""><%=htmlencode(rs("maxim"))%></TEXTAREA>
</TD></TR>
<TR>
<TD colSpan=2 height=24 bgcolor=<%=TablebodyColor1%>> 2.个人选项</TD></TR>
<TR bgcolor=<%=Tablebodycolor2%>>
<TD width=150> 邮件通知</TD>
<TD> <input type="checkbox" name="NewMemberFlag" value="1" <%if rs("NewMemberFlag")=true then response.write "checked"%>>有新成员加入时通知我 <input type="checkbox" name="NewAnnounceFlag" value="1" <%if rs("NewAnnounceFlag")=true then response.write "checked"%>>有新班级留言时通知我
</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>
</body>
</html>
<%
end sub
sub update()
if chkinput=false then
exit sub
end if
dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
StrSQL = "select * from [student] where userid='"&membername&"'"
rs.open StrSQL,conn,1,3
if rs.eof and rs.bof then
errmsg=errmsg+"<br>"+"<li>该用户名不存在!"
call error(errmsg)
exit sub
end if
cp=rs("point")
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("image")=face
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("zipcode")=zipcode
rs("maxim")=maxim
rs("address")=address
rs("NewMemberFlag")=NewMemberFlag
rs("NewAnnounceFlag")=NewAnnounceFlag
rs("theme")=request("theme")
rs("sex")=sex
rs("point")=cp+pModifyInfo
rs.Update
rs.close
%>
<!--#INCLUDE FILE="theme.asp" -->
<%
session("txlpwd")=userpwd
%>
<SCRIPT LANGUAGE="javaScript">
parent.List.location.reload();
//parent.Online.location.reload();
</SCRIPT>
<%
set rs=nothing
stitle="修改资料"
smsg="您已经成功的修改了您的个人信息和个人选项。"
call success(stitle,smsg)
end sub
sub ThemeList(byval mytheme)
set tmprs=conn.execute("Select * from [theme] order by themeid")
response.write "<select name=theme>"
do until tmprs.eof
%>
<option value=<%=tmprs("themeid")%> <%if tmprs("themeid")=mytheme then%> selected <%end if%>>〖<%=tmprs("themename")%>〗</option><%
tmprs.movenext
loop
response.write "</select>"
set tmprs=nothing
end sub
function chkinput()
if chkpost=false then
ErrMsg=ErrMsg+"<Br>"+"<li>您提交的数据不合法,请不要从同学录外部提交信息。"
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")
face=request.form("face")
if face="" then
errmsg=errmsg+"<br>"+"<li>请选择您的个性头像。"
founderr=true
end if
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)<4 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"))
zipcode=trim(request.form("zipcode"))
address=trim(request.form("address"))
if address<>"" and zipcode="" then
errmsg=errmsg+"<br>"+"<li>请输入邮政编码"
founderr=true
end if
if zipcode<>"" and (strLength(zipcode)<>6 or not isinteger(zipcode)) then
errmsg=errmsg+"<br>"+"<li>邮政编码输入错误"
founderr=true
end if
maxim=request.form("maxim")
if strlength(maxim)>200 then
errmsg=errmsg+"<br>"+"<li>人生格言不能大于200个字符。"
founderr=true
end if
NewMemberFlag=request("NewMemberFlag")
if NewMemberFlag="1" then
NewMemberFlag=true
else
NewMemberFlag=false
end if
NewAnnounceFlag=request("NewAnnounceFlag")
if NewAnnounceFlag="1" then
NewAnnounceFlag=true
else
NewAnnounceFlag=false
end if
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 + -