⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 6-2.txt

📁 jsp常用实例讲解
💻 TXT
字号:
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>用 户 注 册</title>
</head>

<body bgcolor="#99CCFF">

<p align="center"><font color="#FF00FF">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face="隶书" size="6">         
<b>用 户 注 册</b></font></font></p>        
<hr>        
<%-- 字符串定义  --%>      
<%      
String get_username=new String();      
String get_password=new String();      
String get_repassword=new String();      
String get_email=new String();      
String get_sex=new String();      
String get_work=new String();      
%>      
<%-- 使用getParameter方法,逐个获取客户端的信息。需要注意的是:引号内的字符大小写时敏感的  --%>     
<%     
get_username=request.getParameter("username");     
get_password=request.getParameter("password");     
get_repassword=request.getParameter("repassword");     
get_email=request.getParameter("email");     
get_sex=request.getParameter("sex");     
get_work=request.getParameter("work");     
%>     
<%--  对于两次输入的密码进行判断,如果一致,就输出显示注册成功的信息 --%>    
<%
if(get_password.equals(get_repassword))    
{    
%>    
<p align="center"><font color="#FF3300">恭喜,您已经成功注册!</font></p>      
<div align="center">      
  <center>      
    <table border="1" width="60%" cellpadding="2">      
      <tr>      
        <td width="50%">      
          <p align="center"><b><font color="#9933FF">用户名称</font></b></td>      
      <td width="50%">      
        <p align="left"><font color="#FF3300"><%=get_username%> </font></td>    
    </tr>    
    <tr>    
      <td width="50%" align="center"><b><font color="#9933FF">用户口令</font></b></td>    
  </center>     
      <td width="50%">  
        <p align="left"><font color="#FF3300"><%=get_password%></font></p>  
      </td>    
    </tr>    
  <center>    
    <tr>    
      <td width="50%" align="center"><b><font color="#9933FF">确认口令</font></b></td>    
  </center>     
      <td width="50%">  
        <p align="left"><font color="#FF3300"><%=get_repassword%></font></p>  
    </td>    
    </tr>    
  <center>    
    <tr>    
      <td width="50%" align="center"><b><font color="#9933FF">电子邮件</font></b></td>    
  </center>     
      <td width="50%">  
        <p align="left"><font color="#FF3300"><%=get_email%></font></p>  
    </td>    
    </tr>    
  <center>    
    <tr>    
      <td width="50%" align="center"><b><font color="#9933FF">性&nbsp;&nbsp;&nbsp;         
        别</font></b></td>        
  </center>      
  <td width="50%">
<p align="left"><font color="#FF3300">
<%-- 在这里,根据字段sex的信息判断应当输出的中文 --%> 
<%  
  if(get_sex.equals("male"))  
  {  
  %>男性<%  
   }  
  else  
  {  
  %>女性<%  
   }  
   %>  
  </font></p> 
 </td>      
  </tr>      
  <center>    
    <tr>      
      <td width="50%" align="center"><b><font color="#9933FF">工&nbsp;&nbsp;&nbsp;         
        作</font></b></td>        
  </center>       
      <td width="50%">    
        <p align="left"><font color="#FF3300"><%=get_work%></font></p>  
    </td>
    </tr>
    </table>
</div>
<%
}
else{
%>
<p align="center"><font color="#FF3300">注册失败!</font></p>
<br>
<p align="center"><font color="#FF3300">请重新注册</font></p>
<%
}
%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -