?? modify.jsp
字號:
<%@ page contentType="text/html; charset=gb2312" import="java.sql.*"%>
<jsp:useBean id="db" class="xwfb.connectDB" />
<html>
<head>
<title>修改密碼</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="css/style.css" rel="stylesheet" type="text/css">
<script language="javascript">
function add()
{
if(add_form.username.value.length == 0 || add_form.psw.value.length == 0 || add_form.psw1.value.length == 0)
{
alert("不能為空");
}
else
{
if(add_form.psw.value != add_form.psw1.value)
{
alert("密碼不一致");
}
else
{
add_form.submit();
}
}
}
</script>
</head>
<%
String psw = request.getParameter("psw");
if(psw == null)
{
%>
<form action="modify.jsp" method="post" name="add_form">
<table>
<tr>
<td width="100" class="text-login">用戶:</td>
<td width="120" class="text-login"><input type="text" name="username" value="<%=(String)session.getAttribute("username")%>" class="inputlength120" maxlength="20" disabled></td>
</tr>
<tr>
<td width="100" class="text-login">密碼:(不小于7位,不超過50位)</td>
<td width="120" class="text-login"><input type="password" name="psw" class="inputlength120" maxlength="20"></td>
</tr>
<tr>
<td width="100" class="text-login">確認密碼:</td>
<td width="120" class="text-login"><input type="password" name="psw1" class="inputlength120" maxlength="20"></td>
</tr>
<tr>
<td width="100" valign="middle"><input type="button" value="提交" onclick="add()" class="logbutton"></td>
<td width="120" valign="middle"><input type="reset" value="重填" class="logbutton"></td>
</tr>
</table>
</form>
<%
}
else
{
try
{
String sql = "update XWFB_USER set password = '"+psw+"' where username = '"+(String)session.getAttribute("username")+"'";
out.print(sql);
db.executeUpdate(sql);
session.removeAttribute("username");
session.removeAttribute("priority");
%>
<script language="javascript">
alert("修改成功");
window.close();
opener.top.location.reload();
</script>
<%
}
catch(Exception e)
{
session.setAttribute("error","1");
response.sendRedirect("error.jsp");
}
finally
{
try
{
db.closeDB();
}
catch(Exception ee)
{
session.setAttribute("error","1");
response.sendRedirect("error.jsp");
}
}
}
%>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -