📄 user_message.asp
字号:
<!--#include file="open.asp" -->
<!--#include file="inc/md5.inc" -->
<%self_name="user_message.asp"%>
<%
doing=request.querystring("doing")
if doing="login" then '用户登录
user_id=trim(request.form("user_id"))
pass=trim(request.form("pass"))
if user_id<>"" and pass<>"" and instr(user_id,"'")=0 and instr(user_id,"&")=0 then
pass=ucase(md5(pass))
str="select * from user_teacher where teacher_user='"&user_id&"' and teacher_pass='"&pass&"'"
set rs=conn.execute(str)
if not rs.eof then
session("zzteacher")=true
session("name")=rs("teacher_name")
session("teacher_user")=user_id
if rs("teacher_class")="超级管理员" then session("zzadmin")=true end if
else
str="select * from user_student where 学籍号='"&user_id&"' and 密码='"&pass&"'"
set rs=conn.execute(str)
if not rs.eof then
session("zzstudent")=true
session("student_id")=user_id
session("name")=rs("姓名")
session("student_bj")=rs("班级")
end if
end if
end if
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><!--#include file="inc/css.css" -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>留溪在线考试</title>
</head>
<body topmargin="1">
<!--#include file="top.asp" -->
<!--#include file="menu.asp" -->
<table width="770" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#ff99cc" bgcolor="#edebdb">
<%if session("zzteacher")=true or session("zzstudent")=true then%>
<tr>
<td height="20" class="unnamed12"><div align="center">用户已登录 用户类别:
<%if session("zzstudent")=true then%>学生 学籍号:<%=session("student_id")%> 姓名:<%=session("name")%> 班级:<%=session("student_bj")%><%end if%>
<%if session("zzteacher")=true then%>教师 姓名:<%=session("name")%><%end if%>
<%if session("zzadmin")=true then%><a href=system_setup.asp>系统设置</a><%end if%>
<a href="quit.asp?back=<%=self_name%>">退出</a></div></td>
</tr>
<%else%>
<tr>
<td height="20" class="unnamed12"> <form name="form1" method="post" action="<%=self_name%>?doing=login">
<div align="center">用户登录 输入学籍号或用户名:
<input name="user_id" type="text" id="user_id" value=<%=id_disp%> size="20">
密码:
<input name="pass" type="password" id="pass" size="16">
<input type="submit" name="Submit" class="unnamed12" value="登录">
<input type="reset" name="Submit2" class="unnamed12" value="重填">
<a href="reg.asp?back=<%=self_name%>">注册</a> <a href="rereg.asp">忘记密码</a></div>
</td></form>
</tr>
<%end if%>
</table>
<table width="770" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="unnamed4"> </td>
</tr>
</table>
<%if session("zzstudent")=true then '修改学生信息开始%>
<%if doing="edit_student" then
sex=request.form("sex")
pass1=trim(request.form("pass1"))
pass2=trim(request.form("pass2"))
pass3=trim(request.form("pass3"))
str="select 密码 from user_student where 学籍号='"&session("student_id")&"'"
set rs=conn.execute(str)
if pass1="" then
str="update user_student set 性别='"&sex&"' where 学籍号='"&session("student_id")&"'"
conn.execute(str)
msg="信息已修改"
else
if pass2<>pass3 then
msg="新密码二次输入不一致"
else
if len(pass2)<6 then
msg="新密码小于六个字符"
else
pass1=ucase(md5(pass1))
if rs("密码")<>pass1 then
msg="原密码不正确,请输入正确密码"
else
pass2=ucase(md5(pass2))
str="update user_student set 性别='"&sex&"',密码='"&pass2&"' where 学籍号='"&session("student_id")&"' and 密码='"&pass1&"'"
conn.execute(str)
msg="资料已修改完成"
doing=""
end if
end if
end if
end if
end if
str="select * from user_student where 学籍号='"&session("student_id")&"'"
set rs=conn.execute(str)%>
<table width="770" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#ff99cc" bgcolor="#edebdb">
<tr>
<td valign="top"> <table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="unnamed10"> </td>
</tr>
</table>
<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form2" method="post" action="user_message.asp?doing=edit_student">
<table width="600" border="1" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#999999">
<td height="30" colspan="3"> <div align="center" class="unnamed18"><strong>学
生 修 改 个 人 资 料</strong></div></td>
</tr>
<tr>
<td width="30%" height="30" class="unnamed14"><div align="right">学
籍 号:</div></td>
<td width="40%" height="30" class="unnamed14"> <%=rs("学籍号")%></td>
<td width="30%" height="30" class="unnamed14"> </td>
</tr>
<tr>
<td width="30%" height="30" class="unnamed14"><div align="right">班 级:</div></td>
<td width="40%" height="30" class="unnamed14"> <%=rs("班级")%></td>
<td width="30%" height="30" class="unnamed14"> </td>
</tr>
<tr>
<td width="30%" height="30" class="unnamed14"><div align="right">姓 名:</div></td>
<td width="40%" height="30" class="unnamed14"> <%=rs("姓名")%></td>
<td width="30%" height="30" class="unnamed14"> </td>
</tr>
<tr>
<td width="30%" height="30" class="unnamed14"><div align="right">性 别:</div></td>
<td width="40%" height="30" class="unnamed14">
<select name="sex" id="sex">
<option value="男" <%if rs("性别")="男" then%>selected<%end if%>>男</option>
<option value="女" <%if rs("性别")="女" then%>selected<%end if%>>女</option>
</select></td>
<td width="30%" height="30" class="unnamed14"> </td>
</tr>
<tr>
<td width="30%" height="30" class="unnamed14"><div align="right">原
密 码:</div></td>
<td width="40%" height="30" class="unnamed14">
<input name="pass1" type="password" id="pass1"></td>
<td width="30%" height="30" class="unnamed12"><font color="#FF0000">若要修改密码须输入原密码</font></td>
</tr>
<tr>
<td width="30%" height="30" class="unnamed14"><div align="right">新
密 码:</div></td>
<td width="40%" height="30" class="unnamed14">
<input name="pass2" type="password" id="pass2"></td>
<td width="30%" height="30" class="unnamed12"><font color="#FF0000">不小于六个字符的新密码</font></td>
</tr>
<tr>
<td width="30%" height="30" class="unnamed14"><div align="right">重复密码:</div></td>
<td width="40%" height="30" class="unnamed14">
<input name="pass3" type="password" id="pass3"></td>
<td width="30%" height="30" class="unnamed12"><font color="#FF0000">二次新密码必须一致</font></td>
</tr>
<tr>
<td height="30" colspan="3"><div align="center">
<input type="submit" name="Submit3" value="修改">
<input type="reset" name="Submit4" value="重置">
</div></td>
</tr>
</table>
<div align="center"><span class="unnamed14h20"><font color="#FF0000">
<%if msg<>"" then response.write msg end if%>
</font></span> </div>
</td></form>
</tr>
</table>
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="unnamed11"> </td>
</tr>
</table></td>
</tr>
</table>
<%end if '修改学生信息结束%>
<%if session("zzteacher")=true then '教师用户进入%>
<%
if doing="edit_teacher" then
pass1=ucase(md5(trim(request.form("pass1"))))
pass2=trim(request.form("pass2"))
pass3=trim(request.form("pass3"))
str="select teacher_pass from user_teacher where teacher_user='"&session("teacher_user")&"'"
set rs=conn.execute(str)
if rs("teacher_pass")<>pass1 then
msg="原密码错误,请输入正确密码"
else
if pass2<>pass3 then
msg="新密码二次输入不一致"
else
if len(pass2)<6 then
msg="密码不能少于六个字符"
else
pass2=ucase(md5(pass2))
str="update user_teacher set teacher_pass='"&pass2&"' where teacher_user='"&session("teacher_user")&"' and teacher_pass='"&pass1&"'"
conn.execute(str)
doing=""
msg="密码已修改,请牢记新密码"
end if
end if
end if
end if
%>
<table width="770" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#ff99cc" bgcolor="#edebdb">
<tr>
<td width="200" valign="top"><table width="163" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="unnamed10"> </td>
</tr>
<tr>
<td background="images/top01.gif" class="unnamed10"> </td>
</tr>
<tr>
<td height="30" background="images/mid01.gif" class="unnamed14"> <div align="center"><strong>学生信息操作</strong></div></td>
</tr>
<tr>
<td height="30" background="images/mid01.gif" class="unnamed12"> <div align="center"><a href="student_insert.asp" class="unnamed12wu">增加学生</a></div></td>
</tr>
<tr>
<td height="30" background="images/mid01.gif" class="unnamed12"><div align="center"><a href="student_list.asp" class="unnamed12wu">浏览编辑</a></div></td>
</tr>
<%if session("zzadmin")=true then%>
<tr>
<td height="30" background="images/mid01.gif" class="unnamed12"> <div align="center"><a href="teacher_edit.asp" class="unnamed12wu">增删教师</a></div></td>
</tr>
<%end if%>
<tr>
<td background="images/bottom01.gif" class="unnamed10"> </td>
</tr>
<tr>
<td class="unnamed10"> </td>
</tr>
</table></td>
<td width="570" valign="top"><table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="unnamed10"> </td>
</tr>
</table>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form3" method="post" action="user_message.asp?doing=edit_teacher">
<table width="480" border="1" cellspacing="0" cellpadding="0">
<tr bgcolor="#999999">
<td height="30" colspan="2"> <div align="center" class="unnamed18"><strong>教
师 修 改 登 录 密 码</strong></div></td>
</tr>
<tr>
<td width="30%" height="30" class="unnamed14">
<div align="right">原 密 码:</div></td>
<td height="30">
<input name="pass1" type="password" id="pass1"></td>
</tr>
<tr>
<td width="30%" height="30" class="unnamed14">
<div align="right">新 密 码:</div></td>
<td height="30">
<input name="pass2" type="password" id="pass2"></td>
</tr>
<tr>
<td width="30%" height="30" class="unnamed14">
<div align="right">重复密码:</div></td>
<td height="30">
<input name="pass3" type="password" id="pass3"></td>
</tr>
<tr>
<td height="40" colspan="2">
<div align="center">
<input type="submit" name="Submit5" value=" 修 改 ">
<input type="reset" name="Submit6" value=" 重 填 ">
</div></td>
</tr>
</table>
<div align="center"> <font color="#FF0000"> <span class="unnamed14h20">
<%if msg<>"" then response.write msg end if%>
</span></font></div>
</td></form>
</tr>
</table>
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="unnamed10"> </td>
</tr>
</table></td>
</tr>
</table>
<%end if '教师用户结束%>
<%if session("zzteacher")<>true and session("zzstudent")<>true then%><!--#include file="index01.asp" --><%end if%>
<!--#include file="inc/bottom.asp" -->
<%conn.close%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -