第六周作业
<%@ 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"> <img src="tp/D1.png" width="700"></img><br/><br/> 用户名: <input type="text" name="name">只能输入字母或数字,4-16个字符<br/><br/> 密码: <input type="password" name="password1">密码长度6-12位<br/><br/> 确认密码: <input type="password" name="password2"><br/><br/> 性别: <input type="radio" name="sex" value="男">男 <input type="radio" name="sex" value="女">女<br/><br/> 电子邮箱: <input type="text" name="Email">请输入正确的Email地址<br/><br/> 出生日期: <input type="text" name="nian">年 <select name="yue"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select>月 <select name="ri"> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> </select>日 <br/><br/> <input type="submit" name="ok" value="同意以下协议条款并提交"><br/><br/> <form action="" method=post> <textarea name="language" id="tom" rows="3" cols="50"> 一、总则 1.用户应当同意本协议的条款并按照页面上的提示完成全部的注册程序。用户在进行注册程序过程中点击“同意”按钮即表示用户与百度公司达成协议,完全接受本协议项下的全部条款。 2.用户注册成功后, 百度将给予每个用户-个用户帐号及相应的密码,该用户帐号和密码由用户负责保管:用户应当对以其用户帐号进行的所有活动和事件负法律责任。; </textarea> </form> </body> </html>
2
<%@ 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 'third.jsp' starting page</title> </head> <body> 求平均值: <form action="fourth.jsp" menthod="post"> 姓名:<input type="text" name="uname"><br> 性别: <input type="radio" value="boy" name="sex">boy <input type="radio" value="girl" name="sex">girl<br> 班级: <select name="banji"> <option>1901</option> <option>1903</option> <option>1904</option> </select><br> 语文:<input type="text" value="98" name="chinese"><br> 数学:<input type="text" value="98" name="math"><br> 英语:<input type="text" value="97" name="english"><br> <input type="submit" value="提交" name="sumbit"> <input type="reset" value="重置" name="reset"> </form> </body> </html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>My JSP 'Two.jsp' starting page</title> </head> <body> <% request.setCharacterEncoding("utf-8"); String name=request.getParameter("name"); String sex=request.getParameter("sex"); String class1=request.getParameter("class"); String yuwen=request.getParameter("chinese"); String shuxue=request.getParameter("maths"); String yingyu=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>