zoukankan      html  css  js  c++  java
  • JSP第四次作业(2)

    <%@ page language="java" contentType="text/html; charset=utf-8"
        pageEncoding="utf-8"%>
    <!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=utf-8">
    <title>登录验证</title>
    </head>
    <body>
      <form action="d.jsp" method="post" name="myform" onSubmit="return checkLogin()">
      <table align="center">
      <tr>
      <td><img src="Snap1.jpg"><div style="position:absolute;left:650px;top:200px;650px;">
      <table width="100%" height="100%" border=0  cellpadding=0 cellspacing=0  >
      <tbody>
      <tr vAlign="top">
      <td width="20%" height="27" align="right" class="bld">用户名:</td>
      <td height="20" align="left"  ><input name="user" type="text" size="30"><br>用户名由字母和数字组成</td>
      </tr>
      <tr vAlign="top">
      <td width="20%" height="27" align="right" class="bld">密码:</td>
      <td height="20" align="left"  ><input name="pwd" type="password" size="30"><br>密码由数字、字母、下划线组成,至少6位</td>
      </tr>
      <tr vAlign="top">
      <td height="27" align="right" class="bld" ></td>
      <td align="left" valign="middle"><a href="#"><input name="submit" type="image" src="login.gif" width="120" height="25" border="0"></a></td>
      </tr>
      </table>
      </div>
      </td>
      </tr>
      </table>
      </form>
    </body>
    </html>
    <%@ page language="java" contentType="text/html; charset=utf-8"
        pageEncoding="utf-8"%>
    <!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=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    <% 
       request.setCharacterEncoding("utf-8");
       String user=request.getParameter("user");
       String pwd=request.getParameter("pwd");
       if(user.equals("lucky")&&pwd.equals("123456")){
           response.sendRedirect("e.jsp");
       }else{
           response.sendRedirect("f.jsp");
       }
       %>
       
    </body>
    </html>
    <%@ page language="java" contentType="text/html; charset=utf-8"
        pageEncoding="utf-8"%>
    <!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=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    你好:lucky
    </body>
    </html>
    <%@ page language="java" contentType="text/html; charset=utf-8"
        pageEncoding="utf-8"%>
    <!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=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
      登录失败
      <br>
      <a href="c.jsp">
      <input type="button" value="重新登录"></a>
    </body>
    </html>

     

  • 相关阅读:
    Node.js
    EFCore-Migrations
    C#核心语法
    C#编程总结--总目录
    PHP ServerPush
    汉字转拼音
    用五分钟重温委托,匿名方法,Lambda,泛型委托,表达式树
    Sublime Text 3 绝对神器
    多线程学习总结
    分享: 利用Readability解决网页正文提取问题
  • 原文地址:https://www.cnblogs.com/lj1221/p/12611693.html
Copyright © 2011-2022 走看看