📄 edit_user.asp
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--#include file="connsf.asp" -->
<!--#include file="md5.inc" -->
<!--#include file="checkstr.asp" -->
<!--#include file="config.asp" -->
<%'检验用户
user=checkstr(session("user"))
pass1=ucase(md5(session("pass")))
str="select 姓名,能否发送 from user_teacher where 用户名='"&user&"' and 密码='"&pass1&"'"
set rs=conn.execute(str)
if rs.eof then
response.redirect("user_login.asp")
else
user_name=rs("姓名")
sendyesno=rs("能否发送")
end if
rs.close
%>
<%doing=Trim(Request.QueryString("doing"))%>
<%'修改基本资料
if doing="edit_basic" then
sex=Trim(Request.Form("sex"))
address=Trim(Request.Form("address"))
address=checkstr(address)
if address="" then address=" "
postadd=Trim(Request.Form("postadd"))
postadd=checkstr(postadd)
if postadd="" then postadd=" "
photno=Trim(Request.Form("photno"))
photno=checkstr(photno)
if photno="" then photno=" "
sql="select * from user_teacher where 用户名='"&user&"' and 密码='"&pass1&"'"
rs.open sql,conn,2,3
rs("性别")=sex
rs("家庭地址")=address
rs("邮政编码")=postadd
rs("电话")=photno
rs.update
rs.close
end if
%>
<%'修改用户密码
if doing="edit_pass" then
old_pass=Trim(Request.Form("old_pass"))
if old_pass<>session("pass") then
msg="输入原密码错!"
else
new_pass=Trim(Request.Form("new_pass1"))
new_pass1=ucase(md5(new_pass))
sql="select * from user_teacher where 用户名='"&user&"' and 密码='"&pass1&"'"
rs.open sql,conn,2,3
rs("密码")=new_pass1
rs.update
rs.close
session("pass")=new_pass
pass1=ucase(md5(session("pass")))
end if
end if
%>
<%'修改用户所处职务部门
if doing="edit_zwbm" then
new_bumen=Trim(Request.Form("new_bumen"))
new_zhiwu=Trim(Request.Form("new_zhiwu"))
new_zhiwu=replace(new_zhiwu," ","")
new_zhiwu=replace(new_zhiwu,",","|")
new_zhiwu="|"&new_zhiwu&"|"
sql="select * from user_teacher where 用户名='"&user&"' and 密码='"&pass1&"'"
rs.open sql,conn,2,3
rs("职务")=new_zhiwu
rs("部门")=new_bumen
rs.update
rs.close
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改个人资料</title>
<!--#include file="css.css" -->
<script LANGUAGE="javascript">
<!--
function editpass_onsubmit() {
var i, n;
if (document.editpass.new_pass1.value=="")
{
alert("对不起,请输入新密码!")
document.editpass.new_pass1.focus()
return false
}
else if (document.editpass.new_pass1.value.length < 5)
{
alert("对不起,新密码须不少于6位!")
document.editpass.new_pass2.focus()
return false
}
else if (document.editpass.new_pass1.value.length > 20)
{
alert("对不起,新密码须不多于20位!")
document.editpass.new_pass1.focus()
return false
}
else if (document.editpass.new_pass1.value != document.editpass.new_pass2.value)
{
alert("对不起,二次密码不一致!")
document.editpass.new_pass2.focus()
return false
}
}
//Function to open pop up window
function openWin(theURL,winName,features) {
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body topmargin="1" oncontextmenu="return false">
<div align="center">
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tabletblg">
<tr>
<td><!--#include file="top.asp" --></td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td class="fontsize04"> </td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td height="30" bgcolor="#6699FF">
<!--#include file="menu.asp" -->
</td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td class="fontsize04"> </td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" bgcolor="#6699FF" class="tablelrb">
<tr>
<td height="30" class="fontsize14"> <%=user_name%>,你好!欢迎使用留溪网上传文系统。 现在可以修改你的个人资料。</td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td class="fontsize04"> </td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td bgcolor="#6699FF"><table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="fontsize10"> </td>
</tr>
</table>
<%str="select * from user_teacher where 用户名='"&user&"'"
set rs=conn.execute(str)%>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form1" method="post" action="edit_user.asp?doing=edit_basic">
<table width="740" border="1" align="center" cellpadding="2" cellspacing="0" borderColorLight="#000000" borderColorDark="#ffffff" bgcolor="#99CCFF">
<tr>
<td width="60" rowspan="7" class="fontsize14"><div align="center" class="fontsize14h20">修<br>
改<br>
用<br>
户<br>
基<br>
本<br>
资<br>
料</div></td>
<td width="260" height="26" class="fontsize14">
<div align="center">用 户 名:</div></td>
<td width="420" class="fontsize12wu"><%=user%></td>
</tr>
<tr>
<td width="260" height="26" class="fontsize14">
<div align="center">用户姓名:</div></td>
<td width="420" class="fontsize12wu"><%=user_name%></td>
</tr>
<tr>
<td width="260" height="26" class="fontsize14">
<div align="center">用户性别:</div></td>
<td width="420" class="fontsize14"><select name="sex" class="inputtext" id="sex">
<option value="男" <%if rs("性别")="男" then%>selected<%end if%>>男</option>
<option value="女" <%if rs("性别")="女" then%>selected<%end if%>>女</option>
</select></td>
</tr>
<tr>
<td width="260" height="26" class="fontsize14">
<div align="center">用户地址:</div></td>
<td width="420" class="fontsize12wu"><input name="address" type="text" class="inputtext" id="address" value="<%=rs("家庭地址")%>" size="50"></td>
</tr>
<tr>
<td width="260" height="26" class="fontsize14">
<div align="center">邮政编码:</div></td>
<td width="420" class="fontsize12wu"><input name="postadd" type="text" class="inputtext" id="postadd" value="<%=rs("邮政编码")%>"></td>
</tr>
<tr>
<td width="260" height="26" class="fontsize14">
<div align="center">电话号码:</div></td>
<td width="420" class="fontsize12wu"><input name="photno" type="text" class="inputtext" id="photno" value="<%=rs("电话")%>"></td>
</tr>
<tr>
<td height="34" colspan="2" class="fontsize14">
<div align="center">
<input name="Submit" type="submit" class="inputbox" value=" 修 改 ">
<input name="Submit2" type="reset" class="inputbox" value=" 重 置 ">
</div></td>
</tr>
</table>
</td></form>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="fontsize10"> </td>
</tr>
</table>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<form name="editpass" LANGUAGE="javascript" onsubmit="return editpass_onsubmit()" method="post" action="edit_user.asp?doing=edit_pass">
<table width="740" border="1" align="center" cellpadding="2" cellspacing="0" borderColorLight="#000000" borderColorDark="#ffffff" bgcolor="#99CCFF">
<tr>
<td width="60" rowspan="4" class="fontsize14"><div align="center" class="fontsize14h20">修<br>
改<br>
密<br>
码</div></td>
<td width="260" height="26" class="fontsize14"> <div align="center">原来密码:</div></td>
<td width="420" class="fontsize12wu"><input name="old_pass" type="password" class="inputtext" id="old_pass"></td>
</tr>
<tr>
<td width="260" height="26" class="fontsize14"> <div align="center">新设密码:</div></td>
<td width="420" class="fontsize12wu"><input name="new_pass1" type="password" class="inputtext" id="new_pass1"></td>
</tr>
<tr>
<td width="260" height="26" class="fontsize14"> <div align="center">验证密码:</div></td>
<td width="420" class="fontsize12wu"><input name="new_pass2" type="password" class="inputtext" id="new_pass2"></td>
</tr>
<tr>
<td height="34" colspan="2" class="fontsize14"> <div align="center">
<input name="Submit3" type="submit" class="inputbox" value=" 修 改 ">
<input name="Submit22" type="reset" class="inputbox" value=" 重 置 ">
</div></td>
</tr>
<%if msg<>"" then%>
<tr>
<td height="24" colspan="3" class="fontsize14"><div align="center"><strong><font color="#FF0000"><%=msg%></font></strong></div></td>
</tr>
<%end if%>
</table>
</td></form>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="fontsize10"> </td>
</tr>
</table>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form2" method="post" action="edit_user.asp?doing=edit_zwbm">
<table width="740" border="1" align="center" cellpadding="2" cellspacing="0" borderColorLight="#000000" borderColorDark="#ffffff" bgcolor="#99CCFF">
<tr>
<td width="60" rowspan="3" class="fontsize14"><div align="center" class="fontsize14h20">修改<br>
职务<br>
部门 </div></td>
<td width="180" height="26" class="fontsize14"> <div align="center">选择部门:</div></td>
<td width="500" class="fontsize12wu"><select name="new_bumen" class="inputtext" id="new_bumen">
<%str="select * from woa_bumeng"
set rs1=conn.execute(str)
if not rs1.eof then
do while not rs1.eof%>
<option value="<%=rs1("部门")%>" <%if rs("部门")=rs1("部门") then%>selected<%end if%>><%=rs1("部门")%></option>
<%rs1.movenext
loop
end if
rs1.close%>
</select></td>
</tr>
<tr>
<td width="180" height="26" valign="top" class="fontsize14">
<div align="center">
<p class="fontsize14h20">选择职务:</p>
</div></td>
<td width="500" class="fontsize12wu"><table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<%str="select * from woa_zhuwu"
set rs1=conn.execute(str)
if not rs1.eof then
m=0
do while not rs1.eof%>
<td width="25%"><input name="new_zhiwu" type="checkbox" id="new_zhiwu" value="<%=rs1("职务")%>" <%if instr(rs("职务"),"|"&rs1("职务")&"|")>0 then%>checked<%end if%>>
<span class="fontsize12"><%=rs1("职务")%></span></td>
<%rs1.movenext
m=m+1
if m mod 4=0 then response.write "</tr><tr>"
loop
end if
rs1.close%>
</tr>
</table></td>
</tr>
<tr>
<td height="34" colspan="2" class="fontsize14"> <div align="center">
<input name="Submit32" type="submit" class="inputbox" value=" 修 改 ">
<input name="Submit222" type="reset" class="inputbox" value=" 重 置 ">
</div></td>
</tr>
</table>
</td></form>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="fontsize10"> </td>
</tr>
</table> </td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelr">
<tr>
<td class="fontsize04"> </td>
</tr>
</table>
<table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<%rs.close%>
<td><!--#include file="bottom.asp" --></td>
</tr>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -