• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
柘冉
博客园    首页    新随笔    联系   管理    订阅  订阅
第四次作业
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<style>
    body{
    width:600;
    height:500px;
    overflow: hidden;
    position: relative;
    background-repeat: no-repeat;
    background-image:url(chengshi_yejing-007.jpg);
    }
    div{
    width: 400px;
    height: 150px;
    padding-top: 10px;
    margin: 50px auto; 
    background: #00000000; 
    position:relative;
    top:100px;
    }
    form{
    width: 300px;
    height: 150px;
    padding-top: 10px;
    margin: 50px auto;                                          
    background: #00000000;                                     
    border-radius: 20px;                                        
    border: 3px solid #f8fcfc;
    opacity: 0.9;
}
    </style>
  <head>
    
  </head>
  <body>
  <div>
    <form action="login.jsp" method="post">
       账号:<input type="text" name="name"><br>
       密码:<input type="password" name="password" ><br>
       验证码:<input type="text" name="yanzheng" >
     <input type="text" name="ma" value="4500" readonly="readonly"><br>
    <input type="submit" value="登录">
    </form>
  </div>
   
  </body>
</html>

 

<%@ page  language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
    <%
        String Name = request.getParameter("name");
        String Password = request.getParameter("password");
        if(Name.equals("zs")&&Password.equals("123")){
          request.getRequestDispatcher("success.jsp").forward(request,response);
    }else{
        request.getRequestDispatcher("fail.jsp").forward(request,response);
    }
           %>
</html>

 

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    

  </head>
  
  <body>
    <h2>您已成功登录</h2>
  </body>
</html>

 

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>


  </head>
  
  <body>
    <h2>登录失败</h2>
  </body>
</html>

 

posted on 2021-03-30 13:41  柘冉  阅读(32)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3