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

📄 reg.jsp

📁 个人论坛的一个java程序
💻 JSP
字号:

<%@page contentType="text/html;charset=GBK"%>


<%	
	String submit = request.getParameter("submit");

	if(submit!=null&&!"".equals(submit)){
		blog.Op_user adduser = new blog.Op_user();
		String msg = adduser.adduser(request);
		if("ok".equalsIgnoreCase(msg)){
			response.sendRedirect("showboard.jsp");
		}
		else{
			response.sendRedirect("error.jsp?msg="+msg);
		}
	}


%>

<html>
<head>
	<title>新用户注册</title>
<script language="javascript">

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

</script>
</head>

<body bgcolor="#DDDDFF">
<form name="form1" method="post" action="reg.jsp">
  
    <table width="450" border="0" cellspacing="1" cellpadding="1" align=center>
 <tr></tr>
      <tr> 
        <td colspan="2" align="center"><b><font color="#0000FF">用户注册</font></b></td>
      </tr>
     <tr></tr>
      <tr> 
        <td width="171" align="right">用户名:</td>
        <td width="272"> 
          <input type="text" name="userName" maxlength="20" size="14" >
        </td>
      </tr>
      <tr> 
        <td width="171" align="right">密码:</td>
        <td width="272">
          <input type="password" name="password" maxlength="20" size="14">
        </td>
      </tr>
      <tr> 
        <td width="171" align="right">确认密码:</td>
        <td width="272">
          <input type="password" name="passconfirm" maxlength="20" size="14">
        </td>
      </tr>
      <tr> 
        <td width="171" align="right">性别:</td>
        <td width="272">
          <select name="sex">
            <option>男</option>
            <option>女</option>
          </select>
        </td>
      </tr>
      <tr> 
        <td width="171" align="right">联系电话:</td>
        <td width="272">
          <input type="text" name="phone" maxlength="25" size="14">
        </td>
      </tr>
      <tr> 
        <td width="171" align="right">电子邮件:</td>
        <td width="272">
          <input type="text" name="email" maxlength="50" size="14">
        </td>
      </tr>
      <tr>
        <td width="171" align="right">&nbsp; </td>
        <td width="272">
          <input type="submit" name="submit" value="submit" onclick="javascript:return(checkform());">
          <input type="reset" name="reset" value="取消">
        </td>
      </tr>
    </table>  
  </form>
 </body>
</html>
  

⌨️ 快捷键说明

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