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

📄 reg.jsp~8~

📁 JBuild工程
💻 JSP~8~
字号:
<%@ page contentType="text/html; charset=gb2312"%>
<%@ page session="true" %>
<jsp:useBean id="user" scope="page" class="check.usermn" />
<%try{
String mesg = "";
String submit = request.getParameter("Submit");
if (submit!=null && !submit.equals("")) {
	if(user.insert(request)){
		session.setAttribute("username",user.getUserName());
		session.setAttribute( "userid", Long.toString( user.getUserid() ) );
		response.sendRedirect("userinfo.jsp?action=regok");
	} else if (!user.getMessage().equals("")) {
		mesg = user.getMessage();
	} else
		mesg = "注册时出现错误,请稍后再试";
}


%>

<html>
<head>
<title>>使用seesion对象进行身份验证</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script type="" language="javascript" src="check.js"></script>
<script type="" language="javascript" >

function openScript(url,name, width, height){
	var Win = window.open(url,name,'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );
}

function checkform() {
	if (document.form1.username.value==""){
		alert("用户名不能为空");
		document.form1.username.focus();
		return false;
	}
	if (document.form1.passwd.value==""){
		alert("用户密码不能为空");
		document.form1.passwd.focus();
		return false;
	}
	if (document.form1.passwd.value!=document.form1.passconfirm.value){
		alert("确认密码不相符!");
		document.form1.passconfirm.focus();
		return false;
	}

	return true;
}

</script>
<link rel="stylesheet" href="books.css" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FF0000}
.style2 {
	color: #FF3300;
	font-size: 16px;
}
body {
	background-color: #FFFFFF;
	background-image: url(image/bg06.jpg);
}
.style3 {color: #336600}
.style4 {
	color: #6633CC;
	font-weight: bold;
}
-->
</style>
</head>

<body text="#000000">
<div align="center">
  <p class="style2">&nbsp;</p>
  <form name="form1" method="post" action="">
  <%if (!mesg.equals("")) out.println("<p><font color=#ff0000>"+ mesg + "</font></p>");%>
   cellspacing="0"> <tr>
           <table width="550" border="0" align="center" cellspacing="0"> <tr>
            <td bgcolor="#000000" width="551">
            <table width="551" border="0" cellspacing="1"
                cellpadding="3"  >
                <tr bgcolor="#99cc00">
                    <td width="543"
                        height="13" colspan="2">
                        <div align="center"><font color="#ffffff" size="2">会员注册
                          </font>
                        </div></td>
              </tr>
      <tr>
                            <td bgcolor="#E7E7E7" width="90" height="19">
                        <font size="2">用户名:</font></td>
 <td bgcolor="#E7E7E7" width="463" height="19">
                        <input name="username" type="text" maxlength="20"  size="20">

                    </td>
                </tr>
                <tr>
                    <td bgcolor="#E7E7E7" width="90" height="19">
                        <font size="2">密 码:</font>
                    </td>
                    <td bgcolor="#E7E7E7" width="463" height="19">
                        <input name="passwd" type="password" maxlength="20" size="20">
                        (至少6位)
                    </td>

                </tr>
 <tr>
                    <td bgcolor="#E7E7E7" width="90" height="19">
                        <font size="2">确认密码:</font>
                    </td>
                    <td bgcolor="#E7E7E7" width="463" height="19">
                        <input name="passconfirm" type="password" maxlength="20" size="20">

                    </td>

                </tr>
      <tr>
                    <td bgcolor="#E7E7E7" width="90" height="19">
                        <font size="2">姓 名:</font>
                    </td>
                    <td bgcolor="#E7E7E7" width="463" height="19">
                        <input name="names" type="text" maxlength="20"  size="20">
                        <font size="2">
                        (请填写你的真实中文名) </font>
                    </td>
                </tr>
     <tr>
                    <td bgcolor="#E7E7E7" width="90" height="20">
                        <font size="2">性 别:</font>
                    </td>
                    <td bgcolor="#E7E7E7" width="463" height="20">
                       <select name="sex">
            <option>男</option>
            <option>女</option>
          </select>
                    </td>
                </tr>
    <tr>
                    <td bgcolor="#E7E7E7" width="90" height="19">
                        <font size="2">联系地址:</font>
                    </td>
                    <td bgcolor="#E7E7E7" width="463" height="19">
                        <input name="address" type="text" maxlength="20" size="50">
                    </td>
                </tr>
     <tr>
                    <td bgcolor="#E7E7E7" width="90" height="19">
                        <font size="2">联系邮编:</font>
       </td>
                    <td bgcolor="#E7E7E7" width="463" height="19">
                        <input type="text" name="post" maxlength="8" size="8">
                    </td>
                </tr>


      <tr>
                    <td bgcolor="#E7E7E7" width="90" height="19">
                        <font size="2">联系电话:</font>
                    </td>
                    <td bgcolor="#E7E7E7" width="463" height="19">
                        <input name="phone" type="text" maxlength="25" size="16">
                    </td>
                </tr>
      <tr>
                    <td bgcolor="#E7E7E7" width="90" height="20">
                        <font size="2">电子邮件:</font>
                    </td>
                    <td bgcolor="#E7E7E7" width="463" height="20">
                        <input name="email" type="text" maxlength="50" size="25">
                    </td>
                </tr>
       <tr align="center" valign="middle" bgcolor="#E7E7E7">
                    <td width="543" height="21" colspan="2">
         <input type="submit" name="Submit" value="注册" onclick="javascript:return(checkform());">
                        <font size="2"></font>
                        &nbsp;
                        <input type="reset" name="reset"
                         value="取消">
                  </td>
              </tr>

    </table>
  </form>
  <p>&nbsp;</p>
</div>
</body>
</html>
<% user.close();//关闭数据库连接
}catch(Exception e){e.printStackTrace();}%>

⌨️ 快捷键说明

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