• jsp第九次作业


    <%@ 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>
        <base href="<%=basePath%>">
        
        <title>My JSP 'index.jsp' starting page</title>
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">    
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="This is my page">
        <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        -->
        <style type="text/css">
        body{font-size:16px;}
        </style>
        <script type="text/javascript">
        function mycheck(){
        if(form1.userName.value==""){
        alert("用户名不能为空,请输入用户名");
        form1.userName.focuse();
        return;
        }
        if(form1.password.value==""){
        alert("密码不能为空,请输入密码");
        form1.password.focus();
        return;
        }
        if(form1.validationCode.value==""){
        alert("验证码不能为空,请输入验证码");
        form1.validationCode.focus();
        return;
        }
        if(form1.validationCode.value!=form1.validationCode1.value){
        alert("请输入正确的验证码");
        form1.validationCode.focus();
        return;
        }
        form1.submit1();
        }
        </script>
      </head>
      
      <body>
       <form action="loginCheck.jsp" name="form1" method="post">
       用户名:<input type="text" name="userName" size="16"><br>
       密    码:
       <input type="password" name="password" size="18"><br>
       验证码:<input type="text" name="validationCode"
            onkeyDown="if(event.keyCode==13){form1.submit.focus();}" size=6>
            <%
            int intmethod1 = (int)(((Math.random())*11)-1);
            int intmethod2 = (int)(((Math.random())*11)-1);
            int intmethod3 = (int)(((Math.random())*11)-1);
            int intmethod4 = (int)(((Math.random())*11)-1);
            //将的到的随机数进行连接
            String intsum = ""+intmethod1+intmethod2+intmethod3+intmethod4;
           %>
           <!--设置隐藏域验证比较时使用  -->
            <input type="hidden" name="validationCode1" value="<%=intsum%>">
            <input type="text"   value="<%=intsum%>"  size=5>
            
       <br>
       <input type="submit" name="submit1" value="登录" onClick="mycheck()">
        
       <input type="reset" value="注册">
        <a href="index.jsp"></a>
       </form>
        
         <br>
      </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>
        <base href="<%=basePath%>">
        
        
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">    
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="This is my page">
        <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        -->
    
      </head>
      
      <body>
    
    用户名:<input type="text" name="uname"  /><Br>
    密码 :<input type="password" name="upwd" /><br>
    Email:<input type="text" name="uemail" /><br>
    <input type="submit" value="完成">
    <a href="login.jsp"></a>
    
      </body>
    </html>

  • 相关阅读:
    在Centos7下源代码安装配置Nginx
    mysql5.7.21源码安装
    数据库设计三大范式
    电商项目中使用Redis实现秒杀功能
    PHP和Redis实现在高并发下的抢购及秒杀功能示例详解
    PHP面向对象(抽象类与抽象方法、接口的实现)
    php面向对象 封装继承多态 接口、重载、抽象类、最终类总结
    利用VHD虚拟文件加密自己的个人信息
    Chrome常用快捷键
    stl本子
  • 原文地址:https://www.cnblogs.com/xffzcjlove/p/12936047.html
Copyright © 2020-2023  润新知