CSDN博客

img newtower

一种新的编程思路(下):附 bbs之register.jsp

发表于2002/7/15 10:11:00  792人阅读

register.jsp

---------------------------------------------------------------------------------

<%@page contentType="text/html;charset=GBK" %>
<%@include file="head.jsp"%>

<%@include file="ntGBDP2002_Define.jsp" %>
<%
  file://全局变量定义
  globalTableName = "bbs_users";
  parentKey       = "BBS用户资料";
  parentValue     = "";
  dbName          = "mhoa";
%>
<%@include file="ntGBDP2002.jsp" %>
<%
  String u = (String)requestHt.get("用户名");
  if( u==null ) u="";
  u = u.trim();

  String errorString = "";
  if( isPost && !nt.isDate((String)requestHt.get("date出生时间")) ){
    errorString = "请填写正确的出生时间!";
  }else if( isPost && !((String)requestHt.get("密码")).equals((String)requestHt.get("nouse确认密码")) ){
    errorString = "请填写正确的密码!";
  }else if( isPost && ( u==null || u.equals("") ) ){
    errorString = "请填写用户名!";
  }else if( isPost && isAdd && nt.executeQuery(dbName,"select * from "+ globalTableName +" where k='用户名' and v='"+u+"' ")>0 ){
    errorString = "已经存在此用户名!";
  }
 
  if( isPost && !errorString.equals("") )
  {
    out.println("<script>alert('"+ errorString +"');history.back();</script>");
    return;
  }

  if( isAdd ){
    requestHt.put("注册日期",(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS")).format(new java.util.Date()) );    
  }

  //
  out.println( "<!-- 1658: " + nt.toDB( requestHt ) + " -->" );
  //
  if( isDelete )
    response.sendRedirect( request.getRequestURI() );
%>

<html>
<head>
<title>闵行办公自动化系统BBS</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/mhs.css" type="text/css">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="778" border="0" cellspacing="1" cellpadding="0" bgcolor="#345487" align="center">
  <tr>
    <td><img src="images/bbs_top.gif" width="776" height="59"></td>
  </tr>
</table>
<table width="778" border="0" cellspacing="1" cellpadding="0" bgcolor="#345487" align="center">
  <tr>
    <td bgcolor="#EEF2F7" height="20">
      <div align="right"><img
            title=Search
            src="images/top10.gif"
            align=absMiddle border=0 name=search width="15" height="15"> <a href="register.jsp">注册</a>
        | <img
            title=Search
            src="images/userlist.gif"
            align=absMiddle border=0 name=search width="16" height="16"> <a href="data.jsp">个人资料</a>
        | <img
            title="Members List"
            src="images/yj.gif"
            align=absMiddle border=0 name=members width="16" height="16"> <a href="login.jsp">用户登入</a>
        | <img
            title=Search
            src="images/icon_search.gif"
            align=absMiddle border=0 name=search width="16" height="15"> <a href="bbs_search.jsp">论坛搜索</a>
        | <img
            title=Search
            src="images/gohome.gif"
            align=absMiddle border=0 name=search width="15" height="15"> <a href="bbs.jsp">返回论坛首页</a>
        | <img
            title=Search
            src="images/gohome.gif"
            align=absMiddle border=0 name=search width="15" height="15"> <a href="../index.jsp">返回OA首页</a>&nbsp;&nbsp;
      </div>
    </td>
  </tr>
</table>
<table width="778" border="0" cellspacing="1" cellpadding="0" align="center">
  <tr>
    <td height="30" width="31"><img src="images/nav.gif" width="21" height="21"></td>
    <td height="30" width="744"><%= hasId?"":"新"  %>用户注册<%= hasId?"修改":""  %></td>
  </tr>
</table>
<table width="776" border="0" cellspacing="1" cellpadding="5" bgcolor="#999999" align="center">

  <form name="frm" method="post" action="<%= request.getRequestURI() %>">
 
  <tr>
    <td background="images/tile_back.gif" height="20"><font color="#FFFFFF">&nbsp;</font></td>
  </tr>
  <tr>
    <td bgcolor="#F5F8FD">
        <table width="770" border="0" cellspacing="1" cellpadding="2" bgcolor="#FFFFFF">
          <tr>
            <td bgcolor="#EEF1F6" width="311" align="right">用户名: </td>
            <td bgcolor="#F5F8FD" width="448">
              <input type="text" name="用户名" size="30" class="b">
              <input type="hidden" name="<%= hasId?"id":"nouse" %>" value="<%= id %>" >
            </td>
          </tr>
          <tr>
            <td bgcolor="#EEF1F6" width="311" align="right"> 密&nbsp;&nbsp;码: </td>
            <td bgcolor="#F5F8FD" width="448">
              <input type="<%
if( ((String)session.getAttribute("用户名")).equals("admin") )
  out.print("text");             
else
  out.print("password");
%>" name="密码" size="30" class="b">
            </td>
          </tr>
          <tr>
            <td bgcolor="#EEF1F6" width="311" align="right"> 确认密码: </td>
            <td bgcolor="#F5F8FD" width="448">
              <input type="password" name="nouse确认密码" size="30" class="b">
            </td>
          </tr>
          <tr>
            <td bgcolor="#EEF1F6" width="311" align="right"> E-mail: </td>
            <td bgcolor="#F5F8FD" width="448">
              <input type="text" name="E-mail" size="30" class="b">
            </td>
          </tr>
          <tr>
            <td bgcolor="#EEF1F6" width="311" align="right"> ICQ号码: </td>
            <td bgcolor="#F5F8FD" width="448">
              <input type="text" name="ICQ号码" size="30" class="b">
            </td>
          </tr>
          <tr>
            <td bgcolor="#EEF1F6" width="311" align="right"> OICQ号码: </td>
            <td bgcolor="#F5F8FD" width="448">
              <input type="text" name="OICQ号码" size="30" class="b">
            </td>
          </tr>
          <tr>
            <td bgcolor="#EEF1F6" width="311" align="right"> 出生时间: </td>
            <td bgcolor="#F5F8FD" width="448">
              <input type="text" name="date出生时间" size="18" class="b" value="1980-12-31">
            </td>
          </tr>
          <tr>
            <td bgcolor="#EEF1F6" width="311" align="right">
              <div align="right">个性签名: <br>
                你可以选择使用个性签名  <br>
                它将显示在你所发布的信息的底部  </div>
            </td>
            <td bgcolor="#F5F8FD" width="448">
              <textarea name="个性签名" rows="3" cols="43" class="textarea" style="overflow: auto; clip:rect( )"></textarea>
            </td>
          </tr>
          <% if( hasId ){ %>
          <tr bgcolor="#EEF1F6">
            <td>
              <div align="right"> 删除本用户: </div>
            </td>
            <td>
              <input type="checkbox" name="delete" value="1">
            </td>
          </tr>
          <% } %>
        </table>
        <div align="center">
          <input type="submit" name="<%= hasId?"edit":"add" %>" value="确定" class="b">
          &nbsp;&nbsp;
          <input type="reset" name="重置" value="重 置" class="b">
        </div>
      </td>
  </tr></form>
</table>
<br>
</body>
</html>

<%@include file="ntGBDP2002_Script.jsp" %>

0 0

相关博文

我的热门文章

img
取 消
img