📄 changpsw.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/conn.asp"-->
<%
if NOT isempty(request("newpswsubmit")) then
dim newpsw,oldpsw,UserName
newpsw=trim(request("newpsw"))
oldpsw=trim(request("oldpsw"))
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [user] where id='"&session("id")&"'",conn,1,3
if not(rs.bof and rs.eof) then
if oldpsw=rs("psw") then
rs("psw") = newpsw
rs.Update
rs.Close
set rs=nothing
response.redirect "nowuser.asp"
else
Response.Write "密码错误!"
rs.Close
set rs=nothing
Response.end
end if
else
Response.Write "没有这个用户!"
rs.Close
set rs=nothing
Response.end
end if
end if
%>
<html>
<head>
<style type="text/css">
<!--
body {
font-size:10pt;
}
td {font-size:9pt}
table{font-size:9pt}
.style4 {color: #E8A477}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<!--#include file="head.asp"-->
<table width="980" border="0" cellpadding="0" cellspacing="0" align="center">
<!--DWLayoutTable-->
<tr>
<td height="14" colspan="4" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="980" height="14"> </td>
</tr>
</table></td>
</tr>
<tr>
<td width="173" rowspan="2" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="173" height="266"><!--#include file="left.htm"--></td>
</tr>
</table></td>
<td height="36" colspan="3" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="760" height="36"><font size="+2"><strong> <span class="style4">修改密码</span></strong></font></td>
</tr>
<tr>
<Td>
<font color="red">
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [user] where id='"&session("id")&"'",conn,1,1
%>
<%= rs("name") %>
</font>请注意,你将要修改你的密码,修改后请务必记住你的密码。
</Td>
</tr>
<tr>
<td width="100%"><hr></td>
</tr>
</table></td>
</tr>
<tr>
<td width="75" height="250"> </td>
<td width="386" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="386" height="250">
<form name="changepsw" method="post" action="changpsw.asp" id="changepsw">
<table>
<!--DWLayoutTable-->
<tr>
<td width="77" height="20" bgcolor="#E8E8E8">旧 密 码:</td>
<td colspan="2"><input type="text" name="oldpsw" id="oldpsw"></td>
</tr>
<tr><td height="6"></td>
<td width="168"></td>
<td width="20"></td>
</tr>
<tr>
<td height="20" bgcolor="#E8E8E8">新 密 码:</td>
<td colspan="2"><input type="text" name="newpsw" id="newpsw"></td>
</tr>
<tr><td height="6"></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="20" bgcolor="#E8E8E8">确认新密码:</td>
<td colspan="2" bgcolor=""><input type="text" name="ensurepsw" id="ensurepsw"></td>
</tr>
<tr><td height="6"></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="23" colspan="2" align="center" valign="top" ><input type="submit" name="newpswsubmit" value="提交" onClick="return checkpsw()"> <input type="reset" value="重写"></td>
<td> </td>
</tr>
</table>
</form>
</td>
</tr>
</table></td>
<td width="299"> </td>
</tr>
</table>
<!--#include file="foot.htm"-->
<script language="JavaScript">
<!--
function checkpsw()
{
if(checkspace(document.changepsw.oldpsw.value)) {
document.changepsw.oldpsw.focus();
alert("请输入旧密码!");
return false;
}
if(checkspace(document.changepsw.newpsw.value)) {
document.changepsw.newpsw.focus();
alert("请输入新密码!");
return false;
}
if(checkspace(document.changepsw.ensurepsw.value)) {
document.changepsw.ensurepsw.focus();
alert("请输入新密码确认!");
return false;
}
if((document.changepsw.ensurepsw.value)!=(document.changepsw.newpsw.value)) {
alert("密码确认输入错误,请重新输入!");
//alert(document.changepsw.ensurepsw.value + document.changepsw.newpsw.value);
document.changepsw.newpsw.focus();
return false;
}
}
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
function regInput(obj, reg, inputStr)
{
var docSel = document.selection.createRange()
if (docSel.parentElement().tagName != "INPUT") return false
oSel = docSel.duplicate()
oSel.text = ""
var srcRange = obj.createTextRange()
oSel.setEndPoint("StartToStart", srcRange)
var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
return reg.test(str)
}
//-->
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -