Register. jsp (preferred for SUN Enterprise applications)
---------------------------------------------------------------------------------
<% @ Page contentType = "text/html; charset = GBK" %>
<% @ Include file = "head. jsp (preferred for SUN Enterprise Applications)" %>
<% @ Include file = "ntGBDP2002_Define.jsp (preferred for SUN Enterprise Applications)" %>
<%
File: // global variable definition
GlobalTableName = "bbs_users ";
ParentKey = "BBS user information ";
ParentValue = "";
DbName = "mhoa ";
%>
<% @ Include file = "ntGBDP2002.jsp (preferred for SUN Enterprise Applications)" %>
<%
String u = (String) requestHt. get ("username ");
If (u = null) u = "";
U = u. trim ();
String errorString = "";
If (isPost &&! Nt. isDate (String) requestHt. get ("date birthdate "))){
ErrorString = "enter the correct birth time! ";
} Else if (isPost &&! (String) requestHt. get ("password"). equals (String) requestHt. get ("nouse Confirm Password "))){
ErrorString = "enter the correct password! ";
} Else if (isPost & (u = null | u. equals (""))){
ErrorString = "Enter the user name! ";
} Else if (isPost & isAdd & nt.exe cuteQuery (dbName, "select * from" + globalTableName + "where k = username and v =" + u + "")> 0 ){
ErrorString = "this user name already exists! ";
}
If (isPost &&! ErrorString. equals (""))
{
Out. println ("<script> alert (" + errorString + "); history. back (); </script> ");
Return;
}
If (isAdd ){
RequestHt. put ("registration date", (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> Minhang Office Automation System 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> </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"> Title = Search
Src = "/edu/UploadPic/2008-2/2008229133940706. gif"
Align = absMiddle border = 0 name = search width = "15" height = "15"> <a href = "register. jsp (preferred for SUN Enterprise Applications) "> Registration </a>