您现在的位置:计算机技术学习网 > 技术中心 > WEB编程 > JSP >

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

来源:未知 责任编辑:智问网络 发表时间:2013-09-26 23:49 点击:

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>

    发表评论
    请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
    用户名: 验证码:点击我更换图片
    最新评论 更多>>

    推荐热点

    • JSP与Servlet
    • 自己动手写MiniBBS系列(基本篇)之用户登录
    • JSP取当前日期
    • JDBC 入门(一)
    • 打开一个jsp页面默认查询所有数据,调用action
    • 使用JSP标签库验证用户的输入(2)完
    • WIN98/2000下的jsp服务器
    • 自定义JSP标签(tag)浅议
    • Struts学习傻瓜式入门篇
    网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
    Copyright © 2008-2015 计算机技术学习交流网. 版权所有

    豫ICP备11007008号-1