• jsp第四次作业


    登录功能  用户名zs 密码123 登录成功  

    要求 有验证码功能  界面要美观

    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <%
        String path = request.getContextPath();
        String basePath = request.getScheme() + "://"
                + request.getServerName() + ":" + request.getServerPort()
                + path + "/";
    %>
    
    <%
        String str = request.getParameter("address");
        String pwd = request.getParameter("password");
        if (null != str) {
            if (str.equals("jy") && pwd.equals("691")) {
                pageContext.forward("a.jsp");
            } else {
                out.println("您输入的账号或密码有误,请重新输入!");
            }
        }
    %>
    
    
    <html>
    <head>
    <form action="" method="post">
        <br> 账号: <input type="text" name="address" size="20"><br>
        密码: <input type="password" name="password" size="21"><br>
        验证码: <input type="text" name="uwv6" size="18"> <img id="yzmtp"
            src="images/1.jpg" width="120px" height="80px" />换一张<br> <input
            type="submit" value="登录" name="a">
    </form>
    </head>
    
    <body style="background:url(images/2.png)";>
    </body>
    </html>
    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    
    
    <html>
      <head>
        
      </head>
      
      <body style="background:url(images/2.png)">
            欢迎登录
    <br>
    </body>
    </html>

  • 相关阅读:
    线程安全及Python中的GIL
    八个我最常用的AS3开源类库(转)
    Mac 10.6与Win7 文件共享
    linux下erlang之OTP编译安装
    位图和矢量图区别
    让你的AIR程序脱离AIR环境运行
    outlook 0x80040201 错误
    NOSQL
    RLE压缩及优化图片压缩
    改正6种常见HTML5错误用法
  • 原文地址:https://www.cnblogs.com/liujiayi123/p/14593023.html
Copyright © 2020-2023  润新知