其他分享
首页 > 其他分享> > 第六周作業

第六周作業

作者:互联网

<%@ 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>
    <title>My JSP 'index.jsp' starting page</title>
<style type="text/css">
textarea {
    overflow-y: auto;
}
.t {
    float: left;
    width: 150px;
    text-align: center;
    text-align-last: justify;
}
 
#y {
    width: 40px;
}
</style>
</head>
<body>
    <img src="img/1.png">
    <div style="background-color: #87CEFA ; float: left;width: 35% ;">
                <span style="float: left;">用户注册</span><a href="#"
                    style="float: right; ">帮助</a>
    </div>
    <form action="index2.jsp" method="post">
        <br /> <span class="t">用户名:</span> <input type="text" name="yhm" />只能输入字母或数字,4-16个字符
        <br /> <span class="t">密码 :</span> <input type="password" name="mm" />密码长度6-12位
        <br /> <span class="t">确认密码 :</span> <input type="password" name="qrmm" /> 
        <br /> <span class="t">性别:</span> 
        <input type="radio" name="xb" value="男" checked="checked" />
               男 <input type="radio" name="xb" value="女" />
               女 <br /> <span class="t">电子邮件地址:</span>
        <input type="email" name="dzyj" />请输入正确的Email地址 <br /> <span
            class="t">出生日期:</span> <input id="y" type="text" name="year" />年 <select
            name="month">
            <option value="1">一</option>
            <option value="2">二</option>
            <option value="3">三</option>
            <option value="4">四</option>
            <option value="5">五</option>
            <option value="6">六</option>
            <option value="7">七</option>
            <option value="8">八</option>
            <option value="9">九</option>
            <option value="10">十</option>            
        </select>月 <select name="day">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
            <option value="6">6</option>
            <option value="7">7</option>
            <option value="8">8</option>
            <option value="9">9</option>
            <option value="10">10</option>
        </select> 日<br /> 
        <input type="submit" value="同意以下协议条款并提交" />
    </form>
    <br>
    <textarea>条款内容...</textarea>
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
 
<html>
  <head>
    
     
    <title>My JSP 'index.jsp' starting page</title>
     
  </head>
   
  <body>
     
  您注册的信息如下:<br>
  <%
  request.setCharacterEncoding("utf-8");
      String uname=request.getParameter("uname");
      String upwd=request.getParameter("upwd");
      String upawd=request.getParameter("upawd");
      String sex=request.getParameter("sex");
      String em=request.getParameter("em");
      String unyear=request.getParameter("unyear");
      String month=request.getParameter("month");
      String day=request.getParameter("day");
   %>
    <%
    if(upwd.equals(upawd)){%>
    你注册的用户名是:<%=uname %><br>
密码是:<%=upwd %><br>
性别是:<%=sex %><br>
电子邮件地址:<%=em %><br>
出生日期:<%=unyear %>年<%=month %>月<%=day %>日<br>
   <%
    }else{
     %>
    两次不一致
    <% }%>
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
    %>
  <head>
    
 
  </head>
   
  <body>
 
 <form action="domarch.jsp" method="post">
 <p>求平均值</p>
姓名:<input type="text" name="name"/><br>
性别:<input type="radio" name="sex" value="男"/>男
 <input type="radio" name="sex" value="女"/>女<br>
 班级:<select name="grade">
 <option>101班</option>
 <option>102班</option>
 </select><br>
 语文: <input type="text" name="chinese"/><br>
 数学: <input type="text" name="math"/><br>
 英语: <input type="text" name="english"/><br>
 <input type="submit" name="提交">
  <input type="reset" name="重置">
 </form>
 
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
 <%
    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
    %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    
  <body>
    <%
            String uname=request.getParameter("uname");
            String sex=request.getParameter("sex");
            String bj=request.getParameter("bj");
            String bir=request.getParameter("bir");
            String math=request.getParameter("math");
            String chinese=request.getParameter("chinese");
            String english=request.getParameter("english");
            double  a=Double.parseDouble(math);
            double  b=Double.parseDouble(chinese);
            double  c=Double.parseDouble(english);
            double arg=(a+b+c)/3;
            out.print("你好!"+bj+"的"+uname+"同学!"+"</br>"+"性别:"+sex+"</br>"+
            "您的各科平均分数是:"+arg);
         %>
  </body>
</html>

 

标签:index,width,text,第六周,密码,JSP,作業,性别
来源: https://www.cnblogs.com/wkw-193230430/p/16126377.html