• jsp第四周作业


    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <title>Title</title>
    </head>
    <body>
        <form action="login.jsp" method="post">
            用户名:
            <input type="text" name="uname"/><br/>
            密码:
            <input type="password" name="upwd"/><br/>
            验证码:
            <img src="number.jsp"/>
            <input type="text" name="code"/>
            <input type="submit" value="登录"/>
        </form>
    
    </body>
    </html>
    <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
    <!DOCTYPE html>
    <html>
    <head>
    </head>
    <body>
        <%
            request.setCharacterEncoding("utf-8");
            String name = request.getParameter("uname");
            String pwd = request.getParameter("upwd");
            String incode = (String)request.getParameter("code");
            String rightcode = (String)session.getAttribute("rCode");
    
            if (name.equals("zs") && pwd.equals("123")&&incode.equals(rightcode)) {
    
                request.getRequestDispatcher("b.jsp")
                        .forward(request, response);
            } else {
    
                request.getRequestDispatcher("index.jsp").forward(request,
                        response);
            }
        %>
    </body>
    </html>
  • 相关阅读:
    linux -- 部署java服务器(3) linux安装redis
    linux 安装php8
    linux mysql查看日志
    linux mysql常用的命令
    perl heredoc
    perl数值进制
    提问的智慧
    How to ask question the smart way
    PERL命令行
    图灵/异步图书
  • 原文地址:https://www.cnblogs.com/sigure0428/p/14589641.html
Copyright © 2020-2023  润新知