码迷,mamicode.com
首页 > 其他好文 > 详细

用户注册信息的输入和显示案例

时间:2017-10-22 21:23:29      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:img   use   utf-8   size   pre   tle   电子邮箱   charset   alt   

<!--新用户注册页面register.jsp-->
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<html>
  <head>    <title>新用户注册</title>  </head>
  
  <body>
  <h3 align="center">新用户注册</h3>
 <form method="POST"action="accept.jsp"name="form1"onsubmit="return on_submit()">
<table>
 <tr><td>用户名(*):</td><td><input type="text"name="username"size="20"></td><tr>
<tr><td> 密&nbsp码(*):</td><td><input type="password"name="password"size="20"></td><tr>
<tr><td> 再输一次密码(*):</td><td><input type="password"name="repassword"size="20"></td><tr>
 <tr><td>性别:</td>
 <td>
    <input type="radio"value="男"checked name="sex">男
    <input type="radio"value="女" name="sex">女
</td>
</tr>
 <tr><td>出生年月:</td>
 <td> <input name="year"size="4"maxlength=4>年
 <!-- 下拉列表框 -->
       <select name="month">       
       <option selected>1</option>
       <optin>2</optin>
       <optin>3</optin>
       <optin>4</optin>
       <optin>5</optin>
       <optin>6</optin>
       <optin>7</optin>
       <optin>8</optin>
       <optin>9</optin>
       <optin>10</optin>
       <optin>11</optin>
       <optin>12</optin>
       </select>月
       <input name="day"size="3"maxlength=4>日</td>
       </tr>
   <tr><td>    电子邮箱(*):<td><input name="email"maxlength="28"></td></tr>
      <tr> <td> 家庭住址:</td><td><input type="text"name="address"size="20"></td></tr>
       <tr>
       <td colspan="2"align="center">
           <input type="submit"value="提交"name="B1">  
        <input type="reset"value="全部重写"name="B2">
        </td>
        </tr>
        </table>
        </form>
  </body>
</html>




<!--接收新用户信息页面accept.jsp-->
<%@ page contentType="text/html;charset=gb2312" language="java" import="java.util.*" pageEncoding="utf-8"%>

<html>
  <head>    <title>接收新用户注册</title>  </head>
  
  <body>
    这是新用户注册所提交的数据:
    <br>
   <%request.setCharacterEncoding("UTF-8"); %> 
   <br>
    用户名:<%=request.getParameter("username") %><br>
    密码是:<%=request.getParameter("userpassword") %><br>
    性别是:<%=request.getParameter("sex")  %><br>
    出生年月是:<%=request.getParameter("year")+request.getParameter("month")+request.getParameter("day") %><br>
    电子邮箱是:<%=request.getParameter("email") %><br>
    家庭住址是:<%=request.getParameter("address") %><br>
  </body>
</html>

  技术分享

技术分享技术分享

用户注册信息的输入和显示案例

标签:img   use   utf-8   size   pre   tle   电子邮箱   charset   alt   

原文地址:http://www.cnblogs.com/www-x/p/7710057.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!