程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> JSP編程 >> 關於JSP >> 一種新的編程思路(下):附 bbs之register.jsp

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

編輯:關於JSP

register.jsp(SUN企業級應用的首選)

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

<%@page contentType="text/html;charset=GBK" %>
<%@include file="head.jsp(SUN企業級應用的首選)"%>

<%@include file="ntGBDP2002_Define.jsp(SUN企業級應用的首選)" %>
<%
  file://全局變量定義
  globalTableName = "bbs_users";
  parentKey       = "BBS用戶資料";
  parentValue     = "";
  dbName          = "mhoa";
%>
<%@include file="ntGBDP2002.jsp(SUN企業級應用的首選)" %>
<%
  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="/edu/UploadPic/2008-2/2008229133939939.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="/edu/UploadPic/2008-2/2008229133940706.gif"
            align=absMiddle border=0 name=search width="15" height="15"> <a href="register.jsp(SUN企業級應用的首選)">注冊</a>

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved