⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 changepw.jsp

📁 JSP页面和oracle9i数据库的源代码
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
body {
	background-image: url(tu/mainbg.gif);
}
-->
</style></head>
<body>
<center><jsp:include page="charu.jsp"></jsp:include></center>
<%
String page_type=(String)session.getAttribute("page_type");
String page_name=(String)session.getAttribute("page_name");
String page_bh=(String)session.getAttribute("page_bh");
if(page_type==null){page_type="";}
boolean page_ok=false;
if(session.isNew()){response.sendRedirect("ptyg.jsp");}
else
 {	if(!(page_type.equals("zg")) || page_bh==null)
	{response.sendRedirect("ptyg.jsp");}	
	else
	{	page_ok=true;
	}
 }
%>
<%if(page_ok==true){%>
<jsp:useBean id="conn" scope="page" class="beans.conn" />
<hr width="780">
<form name="form1" method="post" action="">
  <table  border="0" align="center" cellpadding="5">
    <tr>
      <td colspan="2" nowrap>您的旧密码:
      <input name="oldpw" type="password" id="oldpw" size="16" maxlength="16">
      </td>
    </tr>
    <tr>
      <td colspan="2" nowrap><p>您的新密码:
          <input name="newpw" type="password" id="newpw" size="16" maxlength="16">
          <br>
        (请填写一个小于16位的新密码)</p>        </td>
    </tr>
    <tr>
      <td colspan="2" nowrap>重复新密码:
        <input name="newpwagain" type="password" id="newpwagain" size="16" maxlength="16"></td>
    </tr>
    <tr>
      <td nowrap><div align="center">
        <input type="submit" name="Submit" value="提交">
      </div></td>
      <td nowrap><div align="center">
        <input type="reset" name="Submit2" value="重置">
      </div></td>
    </tr>
  </table>
</form>
<%	String oldpw=request.getParameter("oldpw");
	String newpw=request.getParameter("newpw");
	String newpwagain=request.getParameter("newpwagain");
	boolean pw_ok=true;
	if(oldpw==null || newpw==null || newpwagain==null)
	{	out.print("<center>请正确填写旧密码和新密码以及重复新密码!</center>");pw_ok=false;}
	else
	{	if(oldpw.equals("") || newpw.equals("") || newpwagain.equals(""))
		{	out.print("<center>请完全填写旧密码和新密码以及重复新密码!</center>");
			pw_ok=false;
		}
		if(!newpw.equals(newpwagain))
		{	out.print("<center>您填写的新密码与重复新密码不同请重新填写!</center>");
			pw_ok=false;
		}
		if(!oldpw.equals(""))
		{	String condition_oldpw="select dlmm from zgxx where bh='"+page_bh+"' and dlmm='"+oldpw+"'";
			conn.setcondition(condition_oldpw);
			ResultSet rs=conn.getrs();
			rs.last();
			int all=rs.getRow();
			if(all==0){out.print("<center>您填写的旧密码错误!</center>");pw_ok=false;}
			if(all>1){out.print("<center>数据出现编号重复错误!请与管理员联系!</center>");pw_ok=false;}
			if(all==1&&pw_ok==true)
			{	String condition_changepw="update zgxx set dlmm='"+newpw+"' where bh='"+page_bh+"'";
				conn.setcondition(condition_changepw);
				String result=conn.update();
				out.print(result);
			}
		}
	}
%>
<%}%>
<hr width="780">
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -