站内搜索: 请输入搜索关键词

当前页面: 开发资料首页JSP 专题一种新的编程思路(下):附 bbs之register.jsp

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

摘要: java jsp sql

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( "


<head>
闵行办公自动化系统BBS

<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">

title=Search
src="images/top10.gif"
align=absMiddle border=0 name=search width="15" height="15"> 注册
| title=Search
src="images/userlist.gif"
align=absMiddle border=0 name=search width="16" height="16"> 个人资料
| title="Members List"
src="images/yj.gif"
align=absMiddle border=0 name=members width="16" height="16"> 用户登入
| title=Search
src="images/icon_search.gif"
align=absMiddle border=0 name=search width="16" height="15"> 论坛搜索
| title=Search
src="images/gohome.gif"
align=absMiddle border=0 name=search width="15" height="15"> 返回论坛首页
| title=Search
src="images/gohome.gif"
align=absMiddle border=0 name=search width="15" height="15"> 返回OA首页&nbsp;&nbsp;

</td>
</tr>
</table>
<table width="778" border="0" cellspacing="1" cellpadding="0" align="center">
<tr>
<td height="30" width="31"></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">&nbsp;</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="<% 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">

个性签名: 

你可以选择使用个性签名  

它将显示在你所发布的信息的底部  

</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>
 删除本用户: 

</td>
<td>
<input type="checkbox" name="delete" value="1">
</td>
</tr>
<% } %>
</table>

<input type="submit" name="<%= hasId?"edit":"add" %>" value="确定" class="b">
&nbsp;&nbsp;
<input type="reset" name="重置" value="重 置" class="b">

</td>
</tr></form>
</table>


</body>

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



↑返回目录
前一篇: 一种新的编程思路(下):附 ntGBDP2002_Define.jsp
后一篇: 一种新的编程思路(下):附 自动分页2-1 ntPage.jsp