<%@ 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>
 <head> 
 <style>
 #form div{
 dispiay:flex;
 height:50px;
 align-items:flex-start;}
 #form div label{
 flex:0 0 140px;
 text-align:right;}
 </style>
 </head>
  <body>
   
   <form action="biaodant.jsp" method="post" >
   <div id="form">
        <div>
        <label>用户名:</label> &nbsp &nbsp
        <input type="text" name="uname" minlength="4" maxlength="16"/>只能输入字母或数字,4-16个字符<br>
        </div>
         <div>
        <label>密码:</label> &nbsp &nbsp &nbsp &nbsp
        <input type="password" name="pas1" minlength="6" maxlength="12"/>密码长度6-12位<br>
         </div>
        <div>
        <label>确认密码:</label>
        <input type="password" name="pas2" minlength="6" maxlength="12"/><br>
        </div>
        <div>
        <label>性别:</label> &nbsp &nbsp &nbsp &nbsp
        <input type="radio" name="sex" value ="男"/><input type="radio" name="sex" value ="女"/><br>
          </div>
         <div>
         <label>电子邮件地址:</label>
         <input type="email" name="em" value="0008208820@qq.com" />输入正确的Email地址<br>
         </div>
         <div>
         <label>出生日期:</label>
            <select name="nian">
            <option value="2001">2001</option>
            <option value="2002">2002</option>
            <option value="2003">2003</option>
            <option value="2004">2004</option>
            <option value="2005">2005</option>
        </select><select name="yue">
            <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>
            <option value="11">11</option>
            <option value="12">12</option>
        </select><select name="ri">
            <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>
            <option value="11">11</option>
            <option value="12">12</option>
            <option value="13">13</option>
            <option value="14">14</option>
            <option value="15">15</option>
        </select><br>
         </div>
        &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp<input type="submit" value="同意协议条款并提交"/> <br>
        <textarea name="bz" rows="5" cols="50">解释权归本网站所有</textarea>
       </div>
        </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>
<h3> <b>您注册的信息如下:</b></h3>
<br>
<br>
<%
String uname=request.getParameter("uname");
String password1=request.getParameter("pas1");
String password2=request.getParameter("pas2");
String sex=request.getParameter("sex");
String em=request.getParameter("em");
String nian= request.getParameter("nian");
String yue= request.getParameter("yue");
String ri= request.getParameter("ri");

if(password1.equals(password2)){
out.print("用户名:"+uname+"</br>"+"密码:"+password1+"</br>"
+"性别:"+sex+"</br>"+"电子邮件:"+em+"</br>"+"出生日期:"+nian+"年"+yue+"月"+ri+"日"+"</br>");
}
else{
out.print("两次密码不一样!");
}
%>
</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>
 
  </head>
   
  <body>
<form action="regist.jsp" method="post">
         求平均值:</br>
         <br>
        姓名:<input type="text" name="uname" /><br>
        <br>
        性别:<input type="radio" name="sex" value ="男"/><input type="radio" name="sex" value ="女"/><br>
         <br>
        班级:&nbsp&nbsp&nbsp<select name = "cla">
        <option value="计算机1901">计算机1901</option>
        <option value="计算机1902">计算机1902</option>
        <option value="计算机1903">计算机1903</option>
        <option value="计算机1904">计算机1904</option>
        </select><br>
        <br>
        数学:<input  type="number"  name="math" /></br>
        <br>
        语文:<input  type="number"  name="chin" /></br>
        <br>
        英语:<input  type="number"  name="eng" /></br>
        <br>
        <input type="submit" value="提交"/>
        <input type="reset" value="重置"/>
    </form>
  </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>
    

  </head>
  
  <body>
     
    <%
       request.setCharacterEncoding("utf-8");
       String uname=request.getParameter("uname");
       String sex=request.getParameter("sex");
       String cla=request.getParameter("cla");
       String math=request.getParameter("math");
       String chin=request.getParameter("chin");
       String eng=request.getParameter("eng");
       double  a=Double.parseDouble(math);
       double  b=Double.parseDouble(chin);
       double  c=Double.parseDouble(eng);
       double equi=(a+b+c)/3;
       out.print("你好!"+cla+""+uname+"同学!"+"</br>"+"性别:"+sex+"</br>"+
       "您的各科平均分数是:"+equi);
    %>
  </body>
</html>

 

 

 

posted on 2022-04-06 12:51  郝梦瑶  阅读(39)  评论(0编辑  收藏  举报