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

📄 xgmm.jsp

📁 基于Java实现的聊天室功能
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="Date.*" errorPage="" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
   String shenfen = (String)session.getAttribute("shenfen");
   if(shenfen == null||shenfen.equals("student") == false){
      response.sendRedirect("../errer.jsp");
   }
   String action = (String)request.getParameter("action");
   if(action!=null&&action.equals("do"))
   {
       String username = (String)session.getAttribute("username");
       String password = (String)request.getParameter("password");
       Data data = new Data();
       String sql = "update studentinfo set Stu_password='"+password+"' where Stu_ID='"+username+"'";
       if(data.XiuGaiMiMa(sql))
       out.print("<script>alert('修改成功!')</script>");
       else out.print("<script>alert('修改失败!')</script>");
   }
%>
<link href="../css/css.css" rel="stylesheet" type="text/css">
</head>
<script>
function isok(){
   var str2=document.xgmm.password.value;
   if(str2==""){
      alert("密码不能为空!");
	  document.xgmm.password.focus();
	  return false;
   }
   var str3 = document.xgmm.repassword.value;
   if(str3==""){
      alert("确认密码不能为空!");
	  document.xgmm.repassword.focus();
	  return false;
   }
   if(str2!=str3)
   {
      alert("两次输入的密码不同!");
	  document.xgmm.repassword.focus();
	  return false;
   }
}
</script>
<body>
<form name="xgmm" method="post" action="xgmm.jsp?action=do" onSubmit="return isok();">
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="1" bordercolor="#FFFFFF" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF" >
  <tr>
    <td height="22" colspan="2" align="left" ><strong class="text13">修改密码</strong></td>
  </tr>
    <tr>
      <td height="22" align="center" >新密码:</td>
      <td width="67%" height="22" align="left" ><input name="password" type="password" class="input" id="name" maxlength="20">
          <span class="text13">(*) 20个字符以内 </span></td>
    </tr>
    <tr>
      <td width="33%" height="22" align="center" >确认密码:</td>
      <td height="22" align="left" ><input name="repassword" type="password" class="input" maxlength="20" >
          <span class="text13">(*) 20个字符以内 </span></td>
    </tr>
    <tr>
      <td height="30" colspan="2" align="center" ><input name="Submit" type="submit" class="button" value="修改">
&nbsp;&nbsp;
        <input name="Submit2" type="reset" class="button" value="重置"></td>
    </tr>
</table>
</form>
</body>
</html>

⌨️ 快捷键说明

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