📄 teachermp.asp
字号:
<!--#include file="Function.asp"-->
<!--#include file="Odbc_connection.asp"-->
<%
'--------------------------------------------------防止非法登陆
userok()
'--------------------------------------------------------------
username=session("UserID")
strsql="select * From userinfo Where username='"&username&"'"
set rs=db.execute(strsql)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>-<%=rs("realname")%>-教师密码修改</title>
<link href="wangye9pt.css" rel="stylesheet" type="text/css">
</head>
<script language="JavaScript">
function checkdata() {
if (document.addform.pass.value=='') {
window.alert ("请输入您的旧密码!")
return false}
if (document.addform.password.value=='') {
window.alert ("请输入您的新密码!")
return false}
return true
}
</script>
<body>
<form action="" method="post" name="addform" id="addform" onSubmit="return checkdata()">
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#336699" class="w9pt">
<tr align="center" bgcolor="#336699">
<td height="25" colspan="2" class="w9ptwhite"> 修改用户基本资料
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="36%" height="25" align="right">登陆ID:</td>
<td width="64%" class="9ptred"><%=rs("username")%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25" align="right">旧密码:</td>
<td class="9ptred"><input name="pass" type="password" id="pass" size="10" maxlength="10">
*</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25" align="right">登陆密码:</td>
<td><input name="password" type="password" id="password" size="10" maxlength="10">
<span class="9ptred">*</span></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25" align="right">E-Mail:</td>
<td><input name="Email" type="text" id="Email" size="20"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25" align="right">联系电话:</td>
<td><input name="tel" type="text" id="tel" size="20"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25" align="right">联系地址:</td>
<td><input name="address" type="text" id="address" size="20"></td>
</tr>
<tr valign="middle" bgcolor="#FFFFFF">
<td height="40" colspan="2" align="center">
<input name="imageField" type="image" src="images/modifyp.gif" width="37" height="13" border="0">
<A href="javascript:window.close();" class="w9pt">
【关闭】</a></td>
</tr>
</table>
</form>
</body>
</html>
<%
On Error Resume Next
userok
UserID=session("UserID")
password=trim(request.Form("password"))
pass=trim(request.Form("pass"))
address=trim(request.Form("ADDRESS"))
Email=trim(request.Form("Email"))
tel=trim(request.Form("TEL"))
if password<>"" and pass<>"" then
strsql="select * From userinfo Where username='"&UserID&"'"
set rs=db.execute(strsql)
passok=rs("password")
if passok<>pass then
response.write"<script>alert('修改失败,您的旧密码不正确!')</script>"
response.End()
end if
'-------------------------------------------
if Email="" then
Email="无"
end if
if address="" then
address="无"
end if
if tel="" then
tel="无"
end if
'----------------------------------------------
'------------------------------------------------------------
strsql="Update UserInfo set password='"&password&"',Email='"&Email&"',tel='"&tel&"',address='"&address&"' where username='"&userID&"'"
db.execute(strsql)
response.write"<script>alert('修改登陆密码成功!\n记住新密码"&password&"')</script>"
response.write"<script>window.close()</script>"
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -