⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 regok.jsp

📁 BBS-CS_3b_Tomcat4 java BBS
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=gb2312" %>
<jsp:useBean id="RegisterBean" scope="page" class="com.laoer.bbscs.user.User" />
<jsp:useBean id="CharValidBean" scope="page" class="com.laoer.bbscs.txthtml.CharValid"/>
<html>
<head>
<title>注册</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
<!--
a            { color: #9C0800; text-decoration: none }
a:link       { text-decoration: none; color: #9C0800; font-family: "宋体"}
a:visited    { text-decoration: none; color: #9C0800; font-family: "宋体"}
a:hover      { text-decoration: underline; color: #FF0000}
a:active     { text-decoration: underline; color: #FF0000}
body         { font-size: 14px }
table        { font-size: 14px }
.bt { font-family: 宋体; font-size: 9pt }
-->
</style>
</head>

<body bgcolor="#DB9B24" text="#000000">
<%
String pub=request.getParameter("pub");
String name=request.getParameter("name");
name = name.trim();
String nick=request.getParameter("nick");
nick = nick.trim();
String email=request.getParameter("email");
email = email.trim();
String passwd=request.getParameter("passwd");
passwd = passwd.trim();
String passwd1=request.getParameter("passwd1");
passwd1 = passwd1.trim();
String question=request.getParameter("question");
question = question.trim();
String answer=request.getParameter("answer");
answer = answer.trim();

if (pub.length()>0) {
    if (name.length()>=3 && name.length()<=20 && nick.length()>=3 && nick.length()<=20 && email.length()>=3 && email.length()<=100 && passwd.length()>=3 && passwd.length()<=20 && passwd1.length()>=3 && passwd1.length()<=20 && question.length()>0 && answer.length()>0 ) {
        if (CharValidBean.isChar(name)) {
             if (!RegisterBean.isUser(name)) {
                 if (!RegisterBean.isHaveEmail(email)) {
                     if (passwd.equals(passwd1)) {
                         if (RegisterBean.addUser(name,nick,email,passwd,question,answer)) {
                             out.println("<CENTER>注册成功!<a href='index.html'>返回</a></CENTER>");
                         }
                         else {
                             out.println("<CENTER>注册失败,请稍后再试!<a href='javascript:history.go(-1);'>返回</a></CENTER>");
                         }
                     }
                     else {
                         out.println("<CENTER>密码不一致!<a href='javascript:history.go(-1);'>返回</a></CENTER>");
                     }
                 }
                 else {
                     out.println("<CENTER>Email存在!<a href='javascript:history.go(-1);'>返回</a></CENTER>");
                 }
             }
             else {
                  out.println("<CENTER>用户存在!<a href='javascript:history.go(-1);'>返回</a></CENTER>");
            }
        }
        else {
            out.println("<CENTER>用户名必须是字母或数字!<a href='javascript:history.go(-1);'>返回</a></CENTER>");
        }
    }
    else {
        out.println("<CENTER>请将各项填写完整!<a href='javascript:history.go(-1);'>返回</a></CENTER>");
    }
}
else {
out.println("URL请求错误!");
}
%>
</body>
</html>
<%
RegisterBean.close();
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -