zoukankan      html  css  js  c++  java
  • 5.4号个人冲刺(三)

    
    

    昨天完成了主功能界面的美化

    今天我的任务是实现了表单提交的一些小功能,比如不能为空等提示和表单美化
    明天计划实现时间的显示等细节问题。

    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    
    <jsp:useBean id="db" class="com.jb.db.jdDB"/>
    
    <html>
    
    <head>
    
    <title>捡到表单</title>
    
    </head>
    
    <%
    
      request.setCharacterEncoding("UTF-8");
    
      String   mess="";
    
      String   name=request.getParameter("name");
    
      String   place=request.getParameter("place");
    
      String   time=request.getParameter("time");
    
      String   people=request.getParameter("people");
    
      if(place==null||place==""){
    
      place="未留此信息";
    
      }
    
      boolean mark=true;
    
      if(mark){
    
          String sql="insert into jd values('"+name+"','"+place+"','"+time+"','"+people+"')";
    
          int i=db.insert(sql);
    
          db.closed();
    
          if(i>0)
    
          {
    
           out.print("<script>alert('Form submission was successful!');window.location.href='Maintest.jsp'</script>");
    
           }
    
          else
    
           mess="插入失败!";
    
      }
    
    %>
    
    <body>
    
      <table>
    
       <tr bgcolor="lightgrey">
    
        <td>友情提示!</td>
    
       </tr>
    
       <tr>
    
        <td align="center"><%=mess%></td>
    
       </tr>
    
      </table>
    
      <a href="jiandao.jsp">[返回上一级]</a>
    
      <a href="xuesheng.jsp">[返回学生界面]</a>
    
    </body>
    
    </html>
    

      

  • 相关阅读:
    LeetCode【125. 验证回文串】
    LeetCode【122. 买卖股票的最佳时机 II】
    LeetCode【121. 买卖股票的最佳时机】
    LeetCode【119. 杨辉三角 II】
    LeetCode【118. 杨辉三角】
    LeetCode【112. 路径总和】
    PAT1024
    PAT1020
    PAT1018
    PAT1017
  • 原文地址:https://www.cnblogs.com/zzstdruan1707-4/p/10923157.html
Copyright © 2011-2022 走看看