A new programming idea (below): the register. jsp of bbs

Source: Internet
Author: User

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.