第六次
作者:互联网
1.
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>index.jsp</title> </head> <body> <form action="ZhuCe.jsp" method="post"> 用户名: <input type="text" name="name">只能输入字母或数字,4-16个字符<br/> 密码: <input type="password" name="password1">密码长度6-12位<br/> 确认密码: <input type="password" name="password2"><br/> 性别: <input type="radio" name="sex" value="男">男 <input type="radio" name="sex" value="女">女<br/> 电子邮箱: <input type="text" name="email">请输入正确的Email地址<br/> 出生日期: <input type="text" name="year">年 <select name="month"> <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="date"> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> </select>日 <br/> <input type="submit" value="同意以下协议条款并提交" size="10px" style="width:200px;" /><br> <textarea name="description" style="overflow-y:autio;"> </textarea> </form> </body> </html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body> 您注册的信息如下:<br> <% request.setCharacterEncoding("utf-8"); String name=request.getParameter("name"); String password1=request.getParameter("password1"); String sex=request.getParameter("sex"); String email=request.getParameter("email"); String year=request.getParameter("year"); String month=request.getParameter("month"); String day=request.getParameter("day"); %> 用户名:<%=name %><br> 密码:<%=password1 %><br> 性别:<%=sex %><br> 电子邮箱:<%=email %><br> 出生日期:<%=year %>年<%=month %>月<%=day %>日<br> </body> </html>
2.
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>index.jsp</title> </head> <body> <form action="ZhuCe.jsp" method="post"> 求平均值:<br/><br/> 姓名:<input type="text" name="name" ><br/><br/> 性别:<input type="radio" name="sex" value="男">男 <input type="radio" name="sex" value="女">女<br/><br/> 班级:<select name="class"> <option value="1901">1901</option> <option value="1902">1902</option> <option value="1903">1903</option> <option value="1904">1904</option> <option value="1905">1905</option> </select><br/><br/> 语文:<input type="text" name="chinese" ><br/><br/> 数学:<input type="text" name="maths" ><br/><br/> 英语:<input type="text" name="english" ><br/><br/> <input type="submit" value="提交"> <input type="reset" value="重置"> </form> </body> </html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body> <% request.setCharacterEncoding("utf-8"); String name=request.getParameter("name"); String sex=request.getParameter("sex"); String class1=request.getParameter("class"); String chinese=request.getParameter("chinese"); String maths=request.getParameter("maths"); String english=request.getParameter("english"); double a=Double.parseDouble(chinese); double b=Double.parseDouble(maths); double c=Double.parseDouble(english); double sum=(a+b+c)/3; out.print("你好!"+class1+"班的"+name+"同学"+"<br/>"); out.print("性别:"+sex+"<br/>"); out.print("你的各科平均成绩是:"+sum+"<br/>"); %> </body> </html>
标签:index,密码,nbsp,print,第六次,性别,out 来源: https://www.cnblogs.com/zhao1141754817/p/16126569.html