📄 modifypsw.asp
字号:
<%
dim top_path,pathlevel
top_path="../"
pathlevel="../"
%>
<!--#include file="../share/checkinput.asp" -->
<!--#include file="../database/conn.asp" -->
<!--#include file="../share/md5.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改密码</title>
<link href="../css/c1.css" rel="stylesheet" type="text/css">
</head>
<script language="javascript">
function checkform()
{
if (myform.password.value.length<3)
{
window.message.innerHTML="请输入至少3位密码"
myform.password.focus()
return false
}
if (myform.newpassword.value.length<3)
{
window.message.innerHTML="请输入至少3位新密码"
myform.newpassword.focus()
return false
}
return true
}
function into()
{
myform.password.focus()
}
</script>
<%
username=session("username")
password=request.Form("password")
newpassword=request.Form("newpassword")
if username<>"" and password<>"" and newpassword<>"" then
call checkinput(username&password&newpassword)
password=md5(password)
newpassword=md5(newpassword)
set rs=server.CreateObject("adodb.recordset")
sql="select top 1 u_id from userinfo where username='"&username&"' and password='"&password&"'"
rs.open sql,cn,1,3
if rs.eof then
m="未成功修改密码用户名或密码错误"
else
upsql="update userinfo set password='"&newpassword&"' where username='"&username&"'"
cn.execute(upsql)
m="成功修改了密码 <a href=../survey/index.asp class=userreg_white>返回系统</a>"
end if
rs.close
set rs=nothing
end if
cn.close
set cn=nothing
%>
<body onLoad="into()">
<!--#include file="../share/top.asp" -->
<table style="margin:157px" width=436 height=200 align=center border="0" cellspacing="0" cellpadding="0" class=table0>
<form action="modifypsw.asp" method="post" name="myform" id="myform" onSubmit="return checkform()">
<tr>
<td height="30" colspan="2"><div align="center" class="style2"><span class="top_right_white"> </span><span class="blackfont">修改密码</span></div></td>
</tr>
<tr>
<td colspan="2" height="30" align=center><span class="style3">用 户 名: </span><span class="style2"><font color=red><%=session("username")%></font>
</span></td>
</tr>
<tr>
<td colspan="2" height="30" class="style3"><div align="center">原 密 码:
<input name="password" type="password" id="password" style="width:150px;border: 1px solid #CCCCCC;height:18px" value="" maxlength="20" size="20">
</div></td>
</tr>
<tr>
<td colspan="2" height="30" class="style3"><div align="center">新 密 码:
<input name="newpassword" type="password" id="password" style="width:150px;border: 1px solid #CCCCCC;height:18px" value="" maxlength="20" size="20">
</div></td>
</tr>
<tr>
<td width="210" height="30" nowrap><div align="center">
<div align="center" class="redfont" id="message"><%=m%></div>
</div></td>
<td width="90" height="40"><input type="submit" name="Submit" value="修 改">
</td>
</tr>
<tr>
<td height="18" colspan="2"></td>
</tr>
</table>
</form></table>
<!--#include file="../share/bottom.htm" -->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -