?? editpwd.asp
字號:
<!--#include file="conn.asp"-->
<%
if trim(request("newpwd"))<>"" then
if session("isadmin")="1" then
sql="select * from tbadmin where adminid="&request.cookies("adminid")
else
sql="select * from tbuser where userid="&request.cookies("userid")
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
if rs("pwd")<>trim(request("oldpwd")) then
response.redirect "editpwd.asp?error=wrong"
else
rs("pwd")=trim(request("newpwd"))
rs.update
response.redirect "editpwd.asp?error=ok"
end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title></title>
<base target="_self">
<script language="javascript">
function submitit()
{
var myform=document.editpwd;
if (myform.oldpwd.value=="")
{
alert("原有密碼不能為空!");
return false;
}
else
{
if (myform.newpwd.value=="")
{
alert("新密碼不能為空不能為空!");
return false;
}
else
{
if (myform.confirmpwd.value=="")
{
alert("驗證密碼不能為空!");
return false;
}
else
{
if (myform.newpwd.value!=myform.confirmpwd.value)
{
alert("新設密碼和驗證密碼不相符!");
return false;
}
else
{
return true;
}
}
}
}
}
</script>
<link rel="stylesheet" type="text/css" href="css.css">
</head>
<body topmargin="0" leftmargin="0" style="background-color: #799AE1">
<form method="POST" name="editpwd" action="editpwd.asp" onsubmit="return submitit();">
<center>
<table class=sec_menu border="0" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber1" cellspacing="0" height="123" width="100%">
<tr><td colspan="2" height="16" width="145"><font color="#FF0000">
<%
if request("error")="" then
%>
建議密碼最好在6位以上
<%
else
if request("error")="ok" then
%> 成功修改密碼!
<%
else
%>
舊密碼輸入錯誤!
<%
end if
end if
%></font></td>
</tr>
<tr>
<td height="19" width="69" align="left">原有密碼:</td>
<td height="19" width="78">
<input type="password" name="oldpwd" size="10" onblur="this.className='s01'" onfocus="this.className='inputedit';this.select()" class="s01"></td>
</tr>
<tr>
<td height="19" width="69" align="left">新設密碼:</td>
<td height="19" width="78"></font>
<input type="password" name="newpwd" size="10" onblur="this.className='s01'" onfocus="this.className='inputedit';this.select()" class="s01"></td>
</tr>
<tr>
<td height="19" width="69" align="left">驗證密碼:</td>
<td height="19" width="78">
<input type="password" name="confirmpwd" size="10" onblur="this.className='s01'" onfocus="this.className='inputedit';this.select()" class="s01"></td>
</tr>
<tr>
<td height="30" width="69">
<p align="center">
</td>
<td height="30" width="78">
<input border="0" value="保 存" name="I1" type="submit" class="s02"></td>
</tr>
</table>
</center>
</form>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -